Select ,Update ,Delete and Drop statement
Selecting data in SQL
Before everything we need to talk about SQL query process
The SQL SELECT Statement
The SELECT statement is used to select data from a database.
The data returned is stored in a result table, called the result-set.
Now we got data with famous baseball players!
Or you can mention the columns
Or the columns that you don't want ..for example, I am not interested in last names
WE added a couple of players for an example...we will execute it and refresh the Customer DB
The SQL WHERE Clause
The WHERE clause is used to filter records.
The WHERE clause is used to extract only those records that fulfill a specified
condition.
Now without the " ' "..But Alex is a string , not a column
Now we will specify Mike Piazza
If we highlight the top
The SQL UPDATE Statement
The UPDATE statement is used to modify the existing records in a table.
We will update the new age of Alex Rodriguez
We can see the results after we double check the customer table
We can delete as well the DATA of the table with the delete Command
The SQL DELETE Statement
The DELETE statement is used to delete existing records in a table.
We see the results
When we want to Delete the whole table we will use Drop table command
The SQL DROP DATABASE Statement
The DROP DATABASE statement is used to drop an existing SQL database.
Now we will select our Customer table to see it..
- In case that you want to comment in one line you use --
- In case that you want to comment in a article use /* at the beginning and */ at the end
Select ,Update ,Delete and Drop statement
Reviewed by ohhhvictor
on
4:54 PM
Rating:
No comments: