SQL
What is SQL? ans: SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
What can SQL do? ans: SQL can execute queries against a database
SQL can retrieve data from a database
SQL can insert records in a database
SQL can update records in a database
SQ...
SQL
What is SQL? ans: SQL stands for Structured Query Language. SQL lets you access and manipulate
databases.
What can SQL do? ans: SQL can execute queries against a database
SQL can retrieve data from a database
SQL can insert records in a database
SQL can update records in a database
SQL can delete records from a database
SQL can create new databases
SQL can create new tables in a database
SQL can create stored procedures in a database
SQL can create views in a database
SQL can set permissions on tables, procedures, and views
What is RDBMS and what are some examples? ans: RDBMS stands for Relational Database Management
System. RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM
DB2, Oracle, MySQL, and Microsoft Access. The data in RDBMS is stored in database objects called
tables. A table is a collection of related data entries and it consists of columns and rows.
Are SQL queries case sensitive? ans: SQL keywords are NOT case sensitive: select is the same as SELECT
What goes at the end of each SQL statement? ans: Some database systems require a semicolon at the
end of each SQL statement. Semicolon is the standard way to separate each SQL statement in database
systems that allow more than one SQL statement to be executed in the same call to the server.
What is CRUD? ans: Create, Read/Retrieve (Select), Update and Delete are the four basic functions of
persistent storage.
SELECT Statement ans: The SELECT statement is used to select data from a database. Syntax:
SELECT column_name, column_name
FROM table_name;
SELECT * FROM table_name;
DISTINCT Statement ans: In a table, a column may contain many duplicate values; and sometimes you
only want to list the different (distinct) values. Syntax:
SELECT DISTINCT column_name,column_name
FROM table_name;
WHERE Clause ans: The WHERE clause is used to extract only those records that fulfill a specified
criterion. Syntax:
, SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;
AND/OR Operators ans: The AND & OR operators are used to filter records based on more than one
condition. Syntax:
SELECT * FROM Customers
WHERE Country='Germany'
AND (City='Berlin' OR City='München');
ORDER BY Keyword ans: The ORDER BY keyword is used to sort the result-set by one or more columns.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in a
descending order, you can use the DESC keyword.
SELECT column_name, column_name
FROM table_name
ORDER BY column_name ASC|DESC, column_name ASC|DESC;
INSERT INTO Statement ans: The INSERT INTO statement is used to insert new records in a table.
INSERT INTO table_name
VALUES (value1,value2,value3,...);
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
UPDATE Statement ans: The UPDATE statement is used to update existing records in a table.
UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
Notice the WHERE clause in the SQL UPDATE statement!
The WHERE clause specifies which record or records that should be updated. If you omit the WHERE
clause, all records will be updated!
DELETE Statement ans: The DELETE statement is used to delete rows in a table.
DELETE FROM table_name
WHERE some_column=some_value;
Notice the WHERE clause in the SQL DELETE statement!
The WHERE clause specifies which record or records that should be deleted. If you omit the WHERE
clause, all records will be deleted!
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller HIGHFLYER. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $9.99. You're not tied to anything after your purchase.