Page 73 - 2611_SmartGPT Pro V(5.0) C-8
P. 73
To change the LastName and Address of the student having 32 as StudentID, use the following
command:
DELETING RECORDS FROM A TABLE
The DELETE command is used to remove records from a table. It can be used in two ways:
Without WHERE clause With the WHERE clause
A specific record can be removed using the WHERE clause with the DELETE command. If the
DELETE command is used without the WHERE clause, all the records in the table will be removed.
Here is the command to remove the record of a student whose FirstName is Dev:
To remove all records from a table, use the following command:
DELETE FROM Students
Hashtag
#ANSI SQL standard: A set of rules defined by the American National Standards Institute
to ensure consistency and compatibility of SQL across different database systems.
#PRIMARY KEY: A field used to uniquely identify records in a database.
#FOREIGN KEY: A field in a table that refers to the primary key in another table.
REVISIT
▶ Data includes raw facts, figures or symbols that are yet to be processed into meaningful information.
▶ A database is defined as an organised collection of data that is stored and accessed electronically.
▶ A relational database is a type of database that stores data in the form of tables.
▶ A key is a column or a set of columns that helps us to identify records in a table.
▶ SQL enables us to store, retrieve and manipulate data in the form of tables.
▶ A data type defines the sort of value that a column will contain.
▶ SQL operators are used to perform operations on values in an SQL query.
▶ SQL constraints are used to define rules for table data.
MySQL: My First Database 71

