Here, the SQL command checks if a table namedCompaniesexists, and if not, it creates a table with specified columns. Create Table Using Another Existing Table In SQL, we can create a new table by duplicating an existing table's structure. Let's look at an example. -- create a backup t...
);-- create indexCREATEINDEXcollege_indexONColleges(college_code); Here, the SQL command creates an index namedcollege_indexon theCollegestable using thecollege_codecolumn. SQL CREATE INDEX Syntax The syntax of the SQLCREATE INDEXstatement is: CREATEINDEXindex_nameONtable_name (column_name1, colu...
SQL DROP TABLE Statement SQL ALTER TABLE Statement SQL BACKUP DATABASE Statement SQL Insert, Update and Delete SQL INSERT INTO SQL UPDATE SQL SELECT INTO (Copy Table) SQL INSERT INTO SELECT Statement SQL DELETE and TRUNCATE SQL Constraints SQL Constraints SQL NOT NULL Constraint SQL UNIQUE Constrai...