DATABASE/SQL

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What are Database Tables?

A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.

What does the 'DROP TABLE' SQL statement do?

Deletes a table.

What does the 'DROP INDEX' SQL statement do?

Deletes an index.

What does the 'DELETE' SQL statement do?

Deletes data from a database.

Are Semicolon after SQL Statements important?

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 the difference between Text Fields vs. Numeric Fields?

SQL requires single quotes around text values, however, numeric fields should not be enclosed in quotes.

How many 'PRIMARY KEY' can a table contain?

A table can have only one primary key, which may consist of single or multiple fields.

Why are Constraints important?

Constraints are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the table.

What are SQL Constraints?

Constraints are used to specify rules for the data in a table.

What does the 'SELECT INTO' statement do?

Copies data from one table into a new table.

What does the 'CREATE DATABASE' SQL statement do?

Creates a new database.

What does the 'CREATE TABLE' SQL statement do?

Creates a new table.

What does the 'CREATE INDEX' SQL statement do?

Creates an index (search key).

What is an SQL 'NOT NULL' Constraint?

Enforces a column to NOT accept NULL values. It enforces a field to always contain a value, which means that you cannot insert a new record, or update a record without adding a value to this field.

What is an SQL 'UNIQUE ' Constraint?

Ensures that all values in a column are different.

What are some of the operators in the 'WHERE' clause?

Equal, not Equal, Greater than, Less than, Greater than or equal, Less than or equal, Between an inclusive range, Search for a pattern, and to specify multiple possible values for a column.

How many different ways can you use 'ORDER BY'?

Example, Columns.

What Can SQL do?

Execute queries against a database, retrieve data from a database, insert records in a database, update records in a database, delete records from a database, and set permissions on tables, procedures, and views Create new databases, new tables in a database, stored procedures in a database, and views in a database.

What does the 'SELECT' SQL statement do?

Extracts or selects data from a database.

What happen when Constraints aren't followed?

If there is any violation between the constraint and the data action, the action is aborted.

What does the 'INSERT INTO' SQL statement do?

Inserts new data into a database.

Why is RDBMS important?

It is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.

What does the 'ORDER BY' keyword do?

It is used to sort the result-set in ascending or descending order. Ascending order by default. Also, ASC | DESC keyword to sort in which order.

What's so special about SQL keywords?

Keywords are NOT case sensitive: select is the same as SELECT.

What does the 'ALTER DATABASE' SQL statement do?

Modifies a database.

What does the 'ALTER TABLE' SQL statement do?

Modifies a table.

What are SQL Statements?

Most of the actions you need to perform on a database are done with SQL statements.

What must 'PRIMARY KEY' Constraints contain?

Must contain UNIQUE values, and cannot contain NULL values.

How can you use SQL in Your Web Site?

Need an RDBMS database program (i.e. MS Access, SQL Server, MySQL, to use a server-side scripting language, like PHP or ASP, to use SQL to get the data you want, and to use HTML / CSS to style the page.

What is RDBMS?

Relational Database Management System.

What is SQL?

Structured Query Language. It lets you access and manipulate databases. It is an ANSI (American National Standards Institute) standard.

Where is RDBMS data stored?

The data is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows.

SQL is a Standard - BUT....

There are different versions of the SQL language.

What is an 'PRIMARY KEY' Constraint?

Uniquely identifies each record in a database table.

What does the 'UPDATE' SQL statement do?

Updates data in a database.

What does the 'WHERE' SQL clause do?

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

What is an SQL 'FOREIGN KEY' Constraint?

Used to link two tables together.

What does the 'SELECT DISTINCT' SQL statement do?

Used to return only distinct (different) values.


Ensembles d'études connexes

AWS Cloud Practitioner Essentials

View Set

Chapter 5: Planning and Decision Making Concept Questions

View Set

TAMU HLTH 236 Exam 2 Study Guide

View Set

Fraction Decimal Percent Practice

View Set

Open-Label & Single-Blind Studies - Levien

View Set

Linux - Chapter 12 - Network Configuration

View Set

Chapter 1: Introduction to Financial Management Assignment

View Set