Section 1

Preview this deck

Date

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (78)

Section 1

(50 cards)

Date

Front

Stores year, month, and day values

Back

WHERE Clause

Front

Used to extract only those records that fulfill a specified criterion.

Back

What can SQL do?

Front

lets you access and manipulate databases. execute queries against a database can retrieve data from a database 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

Back

Sum Function

Front

returns the sum of values of the selected column.

Back

AND/OR Operators

Front

used to filter records based on more than one condition.

Back

Timestamp

Front

Stores year, month, day, hour, minute, and second values (combines date and time objects)

Back

SELECT TOP Clause

Front

is used to specify the number or percentage of records to return. Returning a large number of records can impact performance. Note: Not all database systems support this clause.

Back

Aliases (AS)

Front

used to give a database table, or a column in a table, a temporary name.

Back

Real

Front

Approximate numerical, mantissa precision 7

Back

UNION

Front

used to combine the result-set of two or more SELECT statements. Notice that each SELECT statement must have the same number of columns. The columns must also have similar data types. Also, the columns in each SELECT statement must be in the same order.

Back

BETWEEN operator

Front

selects values within a range. The values can be numbers, text, or dates.

Back

Now Function

Front

returns the current system date and time. SELECT NOW() FROM table_name;

Back

Count Function

Front

returns the number of values (NULL values will not be counted) SELECT COUNT(column_name) FROM table_name;

Back

INSERT INTO Statement

Front

used to insert new records in a table

Back

IN Clause

Front

allows you to specify multiple values in a WHERE clause. SELECT * FROM Customers WHERE City IN ('Paris','London');

Back

Lower Case Function

Front

The LCASE() function converts the value of a field to lowercase. SELECT LOWER(column_name) FROM table_name;

Back

Intersect

Front

Use this keyword to return only values that are in the first query AND also in the second query. Same as INNER JOIN

Back

What is CRUD?

Front

Create, Read/Retrieve (Select), Update and Delete. The four basic functions of persistent storage.

Back

Length Function

Front

returns the length of the value in a text field. SELECT LENGTH(column_name) FROM table_name;

Back

SELECT INTO

Front

selects data from one table and inserts it into a new table.

Back

UPDATE Statement

Front

used to update existing records in a table. most include WHERE clause, or all records will be updated!

Back

Group By Function

Front

used in conjunction with the aggregate functions to group the result-set by one or more columns. SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name;

Back

What is SQL stand for?

Front

SQL stands for Structured Query Language.

Back

Binary Object syntax

Front

Binary string. Fixed-length n Syntax: Blob Text Fixed Length Syntax: Binary (fixed up to 8K) Varbinary (<8K) Image (<2GB)

Back

Upper Case Function

Front

The UCASE() function converts the value of a field to uppercase. SELECT UPPER(column_name) FROM table_name;

Back

SELECT Statement

Front

is used to select data from a database.

Back

Array

Front

A set-length and ordered collection of elements

Back

Time

Front

Stores hour, minute, and second values time

Back

Round Function

Front

used to round a numeric field to the number of decimals specified. NOTE: Many database systems have adopted the IEEE 754 standard for arithmetic operations, according to which the default rounding behavior is "round half to even." In this scheme, .5 is rounded to the nearest even integer. So, both 11.5 and 12.5 would be rounded to 12. SELECT ROUND(column_name,decimals) FROM table_name;

Back

LEFT JOIN

Front

returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match.

Back

DELETE Statement

Front

used to delete rows in a table. If you omit the WHERE clause, all records will be deleted!

Back

Float

Front

Approximate numerical, mantissa precision 16

Back

Last Function

Front

returns the last value of the selected column. Only in MS Access SELECT LAST(column_name) FROM table_name;

Back

Average Function

Front

returns the average value of a numeric column.

Back

SQL Function types

Front

Aggregate functions Scalar Functions.

Back

INNER JOIN

Front

selects all rows from both tables as long as there is a match between the columns in both tables.

Back

Having Function

Front

this function was added to SQL because the WHERE keyword could not be used with aggregate functions. SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value;

Back

JOIN

Front

An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them.

Back

Mid Function

Front

is used to extract characters from a text field. SELECT MID(column_name,start,length) AS some_name FROM table_name;

Back

What goes at the end of each SQL statement?

Front

Semicolon is the standard way to separate each SQL statement in database systems

Back

FULL OUTER JOIN

Front

returns all rows from the left table and from right tables

Back

RIGHT JOIN

Front

returns all rows from the right table (table2), with the matching rows in the left table (table1). The result is NULL in the left side when there is no match.

Back

First Function

Front

returns the first value of the selected column. Only in MS Access SELECT FIRST(column_name) FROM table_name;

Back

LIKE Operator

Front

used to search for a specified pattern in a column. SELECT * FROM Customers WHERE City LIKE 's%';

Back

Min Function

Front

returns the smallest value of the selected column. SELECT MIN(column_name) FROM table_name;

Back

ORDER BY Keyword

Front

used to sort the result-set by one or more columns. it sorts the records in ascending order by default. To sort the records in a descending order, you can use the DESC keyword.

Back

Max Function

Front

returns the largest value of the selected column. SELECT MAX(column_name) FROM table_name;

Back

DISTINCT Statement

Front

is used in a table, where a column may contain many duplicate values; and you only want to list the different values.

Back

What is RDBMS and what are some examples?

Front

it is the basis for SQL, and for all modern database systems. The data in is stored in database objects called tables.

Back

Are SQL queries case sensitive?

Front

no they are NOT case sensitive

Back

Section 2

(28 cards)

INDEX

Front

Used to create indexes in tables. Indexes allow the database application to find data fast; without reading the whole table. Note: Updating a table with indexes takes more time than updating a table without (because the indexes also need an update). So you should only create indexes on columns (and tables) that will be frequently searched against.

Back

CREATE VIEW

Front

this creates a virtual table based on the result-set of an SQL statement. You can add SQL functions, WHERE, and JOIN statements and present the data as if the data were coming from one single table.

Back

Views

Front

This is a virtual table.

Back

PRIMARY KEY constraint

Front

uniquely identifies each record in a database table. they must contain UNIQUE values. cannot contain NULL values. Most tables should have one and each table can have only ONE

Back

SQL constraints

Front

used to specify rules for the data in a table. If there is any violation between the constraint and the data action, the action is aborted they can be specified when the table is created (inside the CREATE TABLE statement) or after the table is created (inside the ALTER TABLE statement). CREATE TABLE table_name ( column_name1 data_type(size) constraint_name, column_name2 data_type(size) constraint_name, column_name3 data_type(size) constraint_name, .... );

Back

Integer

Front

numerical (no decimal). Precision p

Back

INSERT INTO INSERT INTO table2 SELECT * FROM table1;

Front

selects data from one table and inserts it into an existing table. Any existing rows in the target table are unaffected.

Back

Subquery

Front

Is a SQL query nested inside a larger query. SELECT a.studentid, a.name, b.total_marks FROM student a, marks b WHERE a.studentid = b.studentid AND b.total_marks > (SELECT total_marks FROM marks WHERE studentid = 'V002');

Back

Boolean

Front

Stores TRUE or FALSE value

Back

Null Values

Front

represent missing unknown data.

Back

AUTO INCREMENT

Front

allows a unique number to be generated when a new record is inserted into a table. Useful on primary keys

Back

CREATE TABLE syntax

Front

CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), .... );

Back

Decimal

Front

Exact numerical, precision p, scale s. Example: decimal(5,2) is a number that has 3 digits before the decimal and 2 digits after the decimal.

Back

Character

Front

a data type. char(32) Character string. Fixed-length n

Back

DROP VIEW syntax

Front

DROP VIEW view_name

Back

NOT NULL Constraint

Front

enforces a column to NOT accept NULL values.

Back

UDPATE VIEW syntax

Front

CREATE OR REPLACE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition

Back

CHECK Constraint

Front

Used to limit the value range that can be placed in a column. If you define this constraint on a single column it allows only certain values for this column. If you define it on a table it can limit the values in certain columns based on values in other columns in the row.

Back

DROP

Front

allows you to easily delete or remove Indexes, tables, and databases

Back

Schema

Front

A collection of database objects (tables) associated with one particular database username. This username is called the schema owner, or the owner of the related group of objects. You may have one or multiple schemas in a database. Basically, any user who creates an object has just created his or her own schema. So, based on a user's privileges within the database, the user has control over objects that are created, manipulated, and deleted. A schema can consist of a single table and has no limits to the number of objects that it may contain, unless restricted by a specific database implementation.

Back

FOREIGN KEY

Front

points to a PRIMARY KEY in another table.

Back

UNIQUE Constraint

Front

uniquely identifies each record in a database table. A PRIMARY KEY constraint automatically has a UNIQUE constraint defined on it. Note that you can have many UNIQUE constraints per table, but only one PRIMARY KEY constraint per table.

Back

DEFAULT Constraint

Front

used to insert a default value into a column. The default value will be added to all new records, if no other value is specified.

Back

CREATE DATABASE syntax

Front

CREATE DATABASE DatabaseName

Back

ALTER

Front

used to add, delete, or modify columns in an existing table. To add a column in a table, use the following syntax: ALTER TABLE table_name ADD column_name datatype ALTER TABLE table_name DROP COLUMN column_name

Back

Variable Character

Front

a data type. Character string varchar(64) Variable length. Maximum length n

Back

Format Function

Front

is used to format how a field is to be displayed. SELECT FORMAT(column_name,format) FROM table_name;

Back

SQL Dates

Front

SQL Server comes with the following data types for storing a date or a date/time value in the database: DATE - format YYYY-MM-DD DATETIME - format: YYYY-MM-DD HH:MI:SS SMALLDATETIME - format: YYYY-MM-DD HH:MI:SS TIMESTAMP - format: a unique number

Back