








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A concise overview of database management applications, focusing on key concepts such as crud operations, data definition and manipulation languages (ddl and dml), and sql syntax. It includes practical examples of select statements, join clauses, and aggregate functions. The document also covers database schema definitions, stored procedures, and various sql commands for table manipulation and data retrieval. It serves as a useful reference for understanding fundamental database principles and query construction, offering insights into relational database models and constraints. It also contains questions and answers about database management applications.
Typology: Exams
1 / 14
This page cannot be seen from the preview
Don't miss anything!









D427 - Database Management Applications Schema - The definition of how data in a database will be organized.
WHERE CUSTNUMB BETWEEN 1 AND 2; - What would the SELECT statement look like if you use a BETWEEN. SELECT * FROM CUSTOMER WHERE HQCITY IN ('Atlanta', 'Chicago', 'Washington'); - What would the SELECT statement look like if you use a IN. SELECT * FROM CUSTOMER WHERE HQCITY LIKE 'W%'; - What would the SELECT statement look like if you use a LIKE. A% - The "%" means that any string of characters can follow afterwards. The percent sign represents zero or more arbitrary regular characters A_ - The _ means that there will be exactly one letter following the A. The underscore represents a single arbitrary regular character. - What are the two ways of using the LIKE command? The clause can include the term ASC at the end to make ascending explicit or it can include DESC for descending order. - The default order for ORDER BY is ascending. How can you make it descending order? SELECT AVG/SUM/MIN/MAX/COUNT(Column_Name) FROM SALES WHERE Name = 'Matt'; - Command to use AVG/SUM/MIN/MAX/COUNT aggregate functions?
USE MainDatabase - The _____ command tells the database system which database you're going to be using for the upcoming commands. SHOW SHOW DATABASES - lists all databases in the database system instance. SHOW TABLES - lists all tables in the default database. SHOW COLUMNS FROM TableName - lists all columns in the TableName table of the default database. SHOW CREATE TABLE TableName - shows the CREATE TABLE statement for the TableName table of the default database. - You can use the _______ statement to provide specified information about a database. ALTAR TABLE TableName Add ColumnName DataType ALTAR TABLE TableName DRIP ColumnName ALTAR TABLE TableName CHANGE CurrentColumnName NewColumnName NewDataType - The ALTAR Table adds, deletes, or modifies columns. What is the syntax for each of these? LIMIT Select * FROM CITY
This will limit it to the first 100 rows. - Some tables may contain thousands or millions of rows, and selecting all rows can take a long time. MySQL has a ______clause that limits the number of rows returned by a SELECT statement. CREATE TABLE Employee ( ID INT, NAME VARCHAR(60), PRIMARY KEY (ID), ); This would make the PRIMARY KEY the ID column. - To set the primary key, you would include it in the _______ __________ statement. The syntax is: CREATE TABLE Department ( Code INT UNSIGNED, ManagerID INT UNSIGNED, PRIMARY KEY (Code), FOREIGN KEY (ManagerID) REFERENCES Employee(ID) ); This would make the ManagerID be a foreign key of the ID column on the employee table. - To set the foreign key, you would include it in the _______ __________ statement. The syntax is:
CREATE TABLE Department ( Code INT UNSIGNED, ManagerID INT UNSIGNED, NAME VARCHAR(60), PRIMARY KEY (Code), FOREIGN KEY (ManagerID) REFERENCES Employee(ID) CHECK NAME (Name = 'Matt'); ); - How to you implement a CHECK constraint? CREATE TABLE Department ( Code INT UNSIGNED, ManagerID INT UNSIGNED, NAME VARCHAR(60), PRIMARY KEY (Code), CONSTRAINT DepartmentForeignKey FOREIGN KEY (ManagerID) REFERENCES Employee(ID) ); - Table constraints may be named using the optional ________ keyword, followed by the constraint name and declaration. If no name is provided, the database generates a default name. INNER JOIN - An ________ JOIN returns only those rows where the linking values match in both of the tables or in result sets. SELECT RecipeTitle, Preparation, RecipeClassDescription FROM Recipe_Classes INNER JOIN Recipes ON Recipe_Classes.RecipeClassID = Recipes.RecipeClassID - INNER JOIN Example OUTER - An _______ JOIN asks your database system to return not only the rows that match on the criteria you specify (as the case with INNER JOIN)
but also the unmatched rows from either one or both of the two sets you want to link. String For example, SELECT LOWER('MySQL'); would return mysql. - ______ functions manipulate string values. HAVING SELECT CountryCode, SUM(Population) FROM City GROUP BY CountryCode HAVING SUM(Population) > 230000; - The _________ clause is used with the GROUP BY clause to filter group results. AS SELECT EmployeeNames AS Names FROM Employee; - To simplify queries or result tables, a column name can be replaced with an alias. The alias follows the column name, separated by an optional _____ keyword. SELECT Department.Name AS GROUP, Employee.Name AS SuperVisor FROM Department FULL JOIN Employee
FROM table_name WHERE condition WITH CHECK OPTION; - To prevent inserts or updates that appear to fail, databases that support view updates have an optional ____________ __________ __________ clause. When this is specified the database rejects inserts and updates that do not satisfy the view query WHERE clause. Instead, the database generates an error message that explains the violation. Entity A person is an entity. So is a building, a piece of inventory sitting on a shelf, a finished product ready for sale, and a sales meeting (an event). - an object or event in our environment that we want to keep track of. Attribute Examples of attributes include an employee's employee number, the weight of an automobile, a company's address, or the date of a sales meeting. - a property or characteristic of an entity. Cardinalities - the maximum number of entities that can be involved in a particular relationship. Modality - the minimum number of entity occurrences that can be involved in a relationship.
Recursive Relationship
access method - The way that we retrieve the data, based on it being stored in a particular file organization, is called the _______ ________.
A file can only be hashed once, based on the values of a single field or a single combination of fields.