ECE356 Lecture Notes - Lecture 6: Referential Integrity, Character Encoding, Mcgraw-Hill Education
Document Summary
We have thus far not yet learned about how to formally create relations. The sql data de nition language (ddl) looks a lot like the query language that we have used thus far, but it allows us to de ne the structure of the data. Speci cally, our data de nition language allows us to de ne [sks11]: the schema of each relation, the type of each attribute, integrity constraints, indices on relations, security/authorization information for a relation, physical storage structure. If we wish to de ne a sql relation, the syntax for this is to create a relation (table) is called (unsurprisingly), The syntax for this command requires a name as well as a listing of the attributes ( elds) and their types (de nitions). It is also customary to include at least one constraint, the primary key. As before we put a semicolon at the end of the statement to designate the end of the statement.