Course Hero Logo

4_Database_creation_part_1.pdf - Today's class To create a...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 6 out of 19 pages.

Today's classTo create a database: SQL statementsConstraintsTo insert data into a database: the INSERT INTOstatementTo ask for info from a database: the SELECTstatement (continued)
To create a database: MySQLstatements
CREATE DATABASESyntax:CREATE DATABASEdatabaseName;As its name indicates, this statement is used to create adatabase. Upon its creation, the database is empty ofany tables.To create a database, one must have admin privileges(admin privileges are granted automatically to the 'root'user – the first user of the database).Once the database is created, one can verify itsexistence by typing the SQL command:SHOWDATABASES;
DROP DATABASESyntax:DROP DATABASEdatabaseName;As its name indicates, this statement is used to drop(delete) a database.This statement is to be used with caution, asdropping a database will lead to total loss of all theinformation stored in it.
CREATE TABLESyntax:CREATE TABLEtable_name(column1 datatype,column2 datatype,column3 datatype,);

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 19 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor
Tags
CREATE TABLE statement

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture