Created by uwais edris
almost 7 years ago
|
||
Question | Answer |
What does SQL stand for? | Structured Query Language (SQL) |
What are the uses of a SQL? | The uses are that it can be used to create, update, and query (search) databases. It consists of standard commands called statements. |
The different data types whcih are often used in a SQL. | |
How SQL works? | The first thing that every database needs is a table. The SQL statement CREATE TABLE creates a database table. |
For each field in the table, you need to speicfy a data type. Some common SQL data types are shown behind. | |
CREATE TABLE students (studentID INTEGER PRIMARY KEY, forename TEXT, surname TEXT, date_of_birth DATE, year_group INTEGER) | This code creates a table with five fields: studentID, forename, surname, date_of_birth and year_group. It gives the data type of each field and makes studentID the primary key |
Once you've created an empty table you'll need to add records to it. You use INSERT INFO command. If you are inserting a complete record you don't need to speicfy the field but if it is incomplete you do. | INSERT INFO students VALUES (01, Uwais, Edris, 10 December 2001, 11) |
To update a reocrd you can use UPDATE-SET-WHERE. | UPDATE students SET date_of_birth = 30 December 2001 WHERE studentID = 01 |
Want to create your own Flashcards for free with GoConqr? Learn more.