answers, Graded A+
What is the difference between DDL, DML, and DCL? Examples? - ✔✔-DDL (data definition language) =
define and manage structure of the database
ex. create, alter, drop table
DML (data manipulation language) = manipulate data
ex. insert into table, update, delete from
DCL (data control language) = controls access to data
ex. grant, revoke
How to create a table in SQL - ✔✔-CREATE TABLE name (
how to alter a table in SQL - ✔✔-ALTER TABLE name
,alters table structure
how to drop a table in SQL - ✔✔-DROP TABLE name;
How to insert data into a table - ✔✔-INSERT INTO name (columns being inserted into)
VALUES (values inserted)
adds records
how to delete data in a table - ✔✔-DELETE FROM name
removes records
How to Update data (SQL) - ✔✔-UPDATE name
modifies existing records
, how to create relationships among tables - ✔✔-using foreign keys
Foreign Key (TableANum) REFERENCES TableA (TableANum),Foreign Key (TableBID) REFERENCES TableB
(TableBID))
how to add column or table constraints - ✔✔-ALTER TABLE Name
ADD new_column data_type
ALTER COLUMN column_name new_data_type
DROP COLUMN column_name
how to reverse commands - ✔✔-ALTER, DELETE FROM, UPDATE
what are the different data types - ✔✔-tinyint
smallint
Int
decimal (p,s)
date: YYYY-MM-DD char(n): where char(10) means a fixed length of 10 characters and missing characters
filled with blank spaces