final comp sci 221

Ace your homework & exams now with Quizwiz!

Choose the recovery log that is generated by the schedule below.

1. start T1 2. start T2 3. update T1, AID, Aoriginal, Anew 4. commit T1 5. update T2, BID, Boriginal, Bnew 6. undo T2, BID, Boriginal 7. rollback T2

A _____ constraint is used to define a column value that is not NULL when no value is provided.

A default constraint is used to define a column value that is not NULL when no value is provided. A default constraint specifies a default value for a column when an INSERT or UPDATE statement does not provide a value for the column.

A value that is used in a computation is known as a/an _____.

A value that is used in a computation is known as an operand. An operand is a value on which an operation is performed. It is the object of a mathematical operation and can be a number, a variable, or any other object that can be manipulated mathematically. In programming, operands are often referred to as arguments or parameters. For example, in the expression "2 + 3," the values "2" and "3" are operands, and the "+" symbol represents the operation of addition.

A view table provides which benefit when created in a database with multiple tables?

A view is a virtual table that is created based on a SELECT statement. It does not store any data itself, but rather displays data from one or more tables in the database. One of the main benefits of using views in a database is that they can provide a simplified way to access and manipulate data from multiple tables. Instead of writing complex queries that join multiple tables, you can create a view that combines the data from these tables in a single virtual table. This makes it easier to query and manipulate the data, as you can treat the view as a single entity rather than dealing with multiple tables individually. Another benefit of views is that they can be used to restrict access to certain columns or rows of data. For example, you can create a view that only displays certain columns or that filters out rows based on certain criteria. This can be useful for controlling access to sensitive data or for simplifying the data that users see. Views can also be used to improve the performance of queries by pre-joining tables or materializing the results of complex queries. This can be especially useful in large databases where queries can take a long time to execute.

Refer to the Product table. Which columns are present in the query's result table? SELECT * FROM Product;

All columns are present

All _____ columns depend on the _____ for a table to be in first normal form.

All non-key columns depend on the primary key for a table to be in first normal form. non-key, primary key

Refer to the stored procedure. What is the correct call syntax to get the number of classes taught by Maggie Wilson with ID - 45631 through a stored procedure call from the command line? CREATE PROCEDURE TeacherClassLoad(IN teachID INT,OUT numberOfClasses INT)SELECT COUNT(*)INTO numberOfClasses FROM ClassWHERE TeacherID = teachID;

CALL TeacherClassLoad(45631, @numberofClasses)

API defines ____ for applications written in a procedural programming language and _____ for applications in object-oriented languages.

Correct answer: procedure calls, classes

Which SQL statement deletes the table Supplier?

DROP TABLE Supplier;

In the Entity-Has-Attribute relationship, what is a required attribute?

Each entity instance has at least one attribute instance.

Which goes in the table on the "many" side of a one-many relationship?

Foreign key

Refer to the Product table. How many rows appear in the query's result table? SELECT DISTINCT Size FROM Product;

Four rows

Refer to the column information produced by SHOW COLUMNS FROM Supplier; statement. CountryId is a foreign key that references the CountryId column in the Country table. Which statement correctly inserts Oshkosh Bgosh? Table with 5 rows and 6 columns. The first row contains headers Field, Type, Null, Key, Default, Extra. The second row contains entries SupplierId, int(11),NO, PRI, NULL, auto_increment. The third row contains entries CompanyName, varchar(40), YES, , NULL, . The fourth row contains entries ContactName, varchar(50), YES, , NULL, . The fifth row contains CountryId, int(11), YES, MUL, NULL, .

INSERT INTO Supplier (CompanyName, CountryId) VALUES ('Oshkosh Bgosh', (SELECT CountryId FROM Country WHERE CountryId = <valid_country_id>));

If a database system is processing three queries as part of a transaction and the third query fails, what happens to the transaction?

If a database system is processing a transaction and one of the queries within the transaction fails, the entire transaction will be rolled back. This means that any changes made by the queries that have been processed before the failure will be undone, and the database will be restored to its state before the transaction began. This is known as atomic behavior, and it is a fundamental property of transactions in database systems. By ensuring that transactions are either completed in their entirety or not completed at all, databases can maintain the integrity and consistency of the data they store.The successful query results are reversed, and the transaction is canceled.

An entity named Stadium contains a primary key SeatNumber and a plural attribute SeatReservation which records spectator seat assignments. During implementation, the plural attributes move to a new table named _____.

If the plural attribute "SeatReservation" in the "Stadium" entity is moved to a new table, the new table could be named "SeatReservations" or "SeatAssignments" to reflect the fact that it contains records of seat assignments for spectators. The name of the new table could also include a reference to the "Stadium" entity, such as "StadiumSeatReservations" or "StadiumSeatAssignments". It is important to choose a descriptive and meaningful name for the new table to help ensure that its purpose and contents are clear to anyone who may need to work with it.

In a relational database model, which concept refers to a finite sequence of values that are derived from defined domains?

In a relational database model, a column refers to a finite sequence of values that are derived from defined domains. A column, also known as an attribute, is a field in a database table that stores a specific piece of data for each record in the table. Each column has a unique name and is associated with a specific data type, which defines the kind of values that can be stored in the column. For example, a column with the data type "integer" can only store whole numbers, while a column with the data type "text" can store alphanumeric characters.

In the following ER diagram, what does 'AlbumTitle' represent? Two tables connected by a line. The first table has header Artist with entries ID, Fname, Lname. The second table has a header Album with entries ID, AlbumYear, AlbumTitle. The word Records appears above the line.

In the given ER diagram, the "AlbumTitle" attribute represents the title of an album recorded by an artist. The diagram shows two tables: an "Artist" table with the attributes "ID", "Fname", and "Lname", and an "Album" table with the attributes "ID", "AlbumYear", and "AlbumTitle". The word "Records" appears above the line connecting the two tables, indicating that there is a relationship between the two entities. This relationship can be interpreted as follows: an artist records one or more albums, and each album is recorded by a specific artist. The "AlbumTitle" attribute is part of the "Album" table and represents the title of the album recorded by the artist.

Which relational algebra operation is denoted by the Greek letter ?

Join

Using a cloud-based database comes with risk. _____ is a regulatory risk.

Privacy

Refer to the tables. Which query produces the result table below?

SELECT S.OrderId, P.ProductName, P.UnitPrice*S.Quantity AS SubTotalFROM Sales S INNER JOIN Product P ON S.ProductId = P.ProductId;

Refer to the Product table. Complete the SQL statement so the result table shows 63, which is the total quantity of all products. SELECT _____ FROM Product;

SUM(Quantity)

An entity named Stadium contains a primary key SeatNumber and a plural attribute SeatReservation which records spectator seat assignments. During implementation, the plural attributes move to a new table named _____.

StadiumSeatReservation

Which type of join does the SQL query below? SELECT LastName, FirstName, CourseTitle FROMTeacher INNER JOIN Class ON Teacher.TeacherID = Class.TeacherID;

The SQL query in the question performs an INNER JOIN, which is also known as an equijoin. An INNER JOIN returns rows from both tables that satisfy the join condition. The join condition specifies the relationship between the two tables and is typically based on a common column or set of columns that exist in both tables. In the example, the join condition is "Teacher.TeacherID = Class.TeacherID," which means that the rows from the Teacher and Class tables are combined based on matching TeacherID values.

Refer to the Teacher and Class tables. The action SET NULL is specified for the TeacherID foreign key. What is the result when Bryan McNeal's TeacherID is changed to 45672?

The TeacherID for Web Development is set to NULL.

What is the purpose of an entity synonym?

To reflect common name usage of the entity.

What does a user that interacts with a database use to read and write data?

Users typically use SQL (Structured Query Language) to read and write data from a database. SQL is a standard programming language used to create, modify, and query databases. It is widely used and supported by most DBMSs and database access interfaces.

When only one value exists in each cell, a table is known to be _____.

When only one value exists in each cell of a table, the table is known to be in first normal form (1NF). First normal form is a property of a table in a relational database that indicates that the table is organized in a way that satisfies certain rules. One of the main rules of 1NF is that each cell in the table must contain only a single value, and not a combination of values or a list of values. This ensures that the data in the table is atomic, meaning that it cannot be divided into smaller units without losing its meaning. Other rules of 1NF include the requirement that each column in the table must have a unique name, and that the table must not have any repeating groups of columns. These rules help to ensure that the data in the table is well-structured and easy to work with. By following the rules of 1NF, it is easier to design and implement efficient and effective database systems. normalized

How are attributes documented in an entity-relationship diagram?

Within an entity rectangle.

A meaningless primary key contains no ______.

descriptive information

Refer to the Teacher and Class tables. The TeacherID in the Class table references the TeacherID in the Teacher table. The TeacherID in the Class table is a/an _____.

foreign key

Distinguishing independent and dependent entities is a(n) _____ process.

iterative

A database administrator uses _____ to eliminate redundancy. This is done by decomposing a table into two or more tables in higher normal form.

normalization

In the relational algebra, compatible tables have the same _____.

number of columns and data types

In a document database, a ________ assigns documents to shards.

range function

______entities have many common attributes and relationships.

related

In order to locate rows selected by a query, an index scan reads index blocks _____.

sequentially


Related study sets

Scrum Guide-scrum events-Sprint Review

View Set

Ch 24 Mgmnt of Pts with Chronic Pulmonary Disease PrepU

View Set

Unit 2 Session 9 Forwards and Futures

View Set

Pharmacology Chapter 14- Antineoplastic Agents

View Set

A & P Lab- Ex 12: Skeletal Muscle

View Set

Accounting Multiple Choice Chapter 11

View Set

Chapter 25: The Great Depression, 1929-1939

View Set

High Acuity- Section Review Questions

View Set

Unit 3.1 Financial Statement Analysis and Ratios

View Set