Anda di halaman 1dari 23

Which of the following is NOT a DBMS software?

d

a. postgresql
b. MySQL
c. Oracle
d. impresql
e. DB2
f. no answer

Which of the following are true about the mysql client program? (choose three) bcd

a. when run in batch mode, it interprets commands contained in a script file
b. when run in batch mode, it executes commands entered manually by the
user on its command line
c. when run in interactive mode, it allows the user to type commands and
sends them to the database server
d. it may run in interactive or batch mode
e. when run in interactive mode, it interactively executes SQL instructions
contained in a file

Which of the following categories of instructions are part of the SQL
language?(choose three) a,d,e

a. DML (Data Manipulation Language)
b. DTL (Data Transmission Language)
c. DQL (Data Query Language)
d. DCL (Data Control Language)
e. DDL (Data Definition Language)

On a relational DBMS there may be multiple ___ defined. Each of them may contain
one or more ___, which in turn contain the data in the form of ___ . (choose the
proper combination to fill in the blanks) c

a. databases, tables, records
b. attributes, rows, tables

c. databases, rows, tables
d. columns, tables, attributes
e. records, rows, databases

f. no answer

Which of the following are true regarding case sensitivity in MySQL? (choose three)

a. table names are not case sensitive
b. column names may be case sensitive or not, depending on the underlying
operating system
c. database names may be case sensitive or not, depending on the
underlying operating system
d. column names are not case sensitive
e. table names may be case sensitive or not, depending on the underlying
operating system c,d,e


An SQL script is: c

a. a file containing data to be imported into a table column
b. a file that contains only the data to be imported into a database, but no
SQL instructions
c. a text file containing a list of SQL instructions to be executed by a
database server
d. the same thing as a Linux shell script
e. a stand-alone executable file that contains binary data to be inserted into
a database
f. no answer


Remote clients can connect to a MySQL server using: b

a. socket files
b. TCP/IP
c. shared memory
d. ICMP
e. named pipes
f. no answer



The SQL language contains instructions that allow a client to: (choose three) A,D, E

a. extract data from tables
b. modify the database server's configuration file
c. restart the database server
d. enter data into tables
e. define and modify the structure of a database and its tables


Which of the following are valid line terminators in the mysql command line? (choose
three) A,B,E

a. \g
b. ;
c. /G
d. \;
e. \G
f. /g



Which of the following are characteristics of a column from a relational database
table? (choose three)

a. name
b. optional additional properties
c. SQL dialect
d. data type
e. storage engine
A,B,D

Which of the following are responsibilities of a DBMS? (choose three)BCE

a. upgrading the operating system
b. controlling access to data

c. data storage and management

d. issuing SQL commands that will be sent to the clients
e. interaction with clients

If the name of a MySQL database contains a space character, how should it be used
in MySQL instructions?a

a. the name of the database must be quoted using ' (single-quote)
characters
b. the name of the database must be quoted using ` (back-quote) characters
c. the name of the database must be quoted using : (colon) characters
d. the name of a MySQL database may never contain spaces
e. as it is space is not a special character
f. no answer


Which of the following is NOT a database model?c

a. flat-file
b. network
c. expectational
d. hierarchical
e. relational
f. no answer


Given a database named Store that contains a table named Products which has a
column named Price, which of the following are proper ways to refer to the Price
column from within a MySQL instruction? (choose two)e,f

a. `Store`.`Products`.`Price`
b. Store.Price
c. `Store.Products.Price`
d. Products.Store.Price
e. Store.Products.Price
f. /Store/Products/Price




What information does a user need to have in order to be able to connect to a
remote database server? (choose two)a,b

a. the address of the database server
b. the username and password
c. the database server's operating system
d. the server's hardware configuration
e. the directory in the database server's filesystem where database
information is stored



SQL is: e

a. the name of a network protocol
b. the name of a database server software
c. a DBMS
d. the same thing as MySQL
e. a language used for querying relational database servers
f. no answer







Curs 2
What will be the default value of the column with the following definition? e

Name VARCHAR(10)

a. the empty string ""
b. 0
c. the column will have no default value
d. NULL
e. a character string consisting of 10 space characters
f. no answer


Which of the following elements is NOT part of an SQL table definition? a

a. table data location on hard disk
b. list of column definitions
c. table name
d. storage engine
e. no answer


Which of the following SQL statements will remove all the rows from a table named
Products, leaving the table's structure intact? A

a. TRUNCATE TABLE Products
b. ALTER TABLE Products
c. DROP TABLE Products
d. DELETE TABLE Products
e. EMPTY TABLE Products
f. no answer



Given the following MySQL data types and a list of categories that they pertain to,
choose the answer that correctly matches each data type with its category: c

a. VARCHAR
b. INT
c. DATE
d. SET

1. number
2. enumerated data
3. character string
4. temporal data

a. a 3, b 1, c 2, d 4
b. a 2, b 4, c 1, d 3
c. a 3, b 1, c 4, d 2
d. a 1, b 2, c 3, d 4
e. a 4, b 2, c 1, d 4
f. no answer


Which of the following databases exist by default in MySQL? (choose two) b,e

a. privileges
b. mysql
c. server
d. meta_inf
e. information_schema










Which of the following SQL statements could be used for adding a column to a table
named People and placing it last in the column list? b

a. ALTER TABLE People ADD COLUMN Age INT;
b. ALTER TABLE People ADD COLUMN Age LAST;
c. ALTER TABLE People ADD COLUMN Age TINYINT FIRST;
d. ALTER TABLE People ADD COLUMN Age TINYINT AFTER LAST;
e. ALTER TABLE People DROP COLUMN Age INT;
f. no answer


Choosing a certain storage engine when creating a MySQL table could affect the
following aspects: (choose three) A B E

a. transactional capabilities of the table
b. data storage format on the server
c. possible data types
d. names of columns
e. performance of data manipulation operations


Which of the following are valid MySQL instructions for creating a database named
Products? (choose four) A D E F

a. CREATE DATABASE Products CHARACTER SET latin1 COLLATE
latin1_general_ci
b. CREATE DATABASE Products ENGINE=InnoDB
c. CREATE SCHEMA IF EXISTS Products
d. CREATE SCHEMA IF NOT EXISTS Products CHARACTER SET latin1
COLLATE latin1_general_ci
e. CREATE DATABASE Products
f. CREATE SCHEMA Products


Which of the following are valid SQL column definitions? (choose two) b c

a. Username NOT NULL VARCHAR(50)
b. MaxParticipants TINYINT NOT NULL DEFAULT 30
c. Name VARCHAR(100)
d. Distance HUGEINT NOT NULL
e. Married NOT NULL DEFAULT 'no'

Which of the following is true about a temporary SQL table? C

a. a temporary table may not have the same name as an existing regular table
b. a temporary table will automatically be deleted when the client that created it
disconnects from the server
c. a temporary table is identical to a regular table in every way, except it is
deleted on server restart
d. if a client has created a temporary table, other clients will not be allowed to
create tables with the same name
e. a temporary table created by one SQL client can be seen by other SQL
clients
f. no answer


Which of the following SQL instructions could be used for removing a database named
Movies? (choose three) A b D

a. DROP DATABASE Movies
b. DROP SCHEMA Movies
c. DELETE SCHEMA Movies
d. DROP DATABASE IF EXISTS Movies
e. DROP SCHEMA IF NOT EXISTS Movies




Which of the following storage engines is built-in into MySQL and cannot be disabled? e

a. MERGE
b. MEMORY
c. InnoDB
d. FEDERATED
e. MyISAM
f. no answer

What MySQL instruction could be used for finding a table's storage engine? A

a. SHOW CREATE TABLE
b. DESCRIBE
c. SHOW TABLE
d. SHOW DESCRIBE TABLE
e. SHOW DATABASE STATUS

f. no answer

What is the proper SQL instruction for listing only MySQL databases whose names
begin with the letter h? b

a. SHOW DATABASES LIKE '%h_'
b. SHOW SCHEMAS LIKE 'h%'
c. SHOW DATABASES LIKE 'h*'
d. LIST DATABASES LIKE 'h%'
e. SHOW DATABASES LIKE '_h'
f. no answer








How can a MySQL table be created? (choose three) b c d

a. by using the MAKE TABLE statement
b. by copying the structure of an existing table
c. by using the data from a query result
d. by using the CREATE TABLE statement and specifiying the column
definitions
e. by using the SHOW CREATE TABLE statement

Which of the following elements are part of a column definition? (choose three) A C E

a. column data type
b. column height
c. optional column modifiers
d. column storage engine
e. column name

Curs 3

Given the table created with the definition below, which of following statements will
correctly insert a new record having non-null values for both columns?

CREATE TABLE ScaryMovies(Title VARCHAR(100), Minutes INT) e

a. INSERT INTO ScaryMovies(*) VALUES('Braindead', 104)
b. INSERT INTO ScaryMovies(Title) VALUES('Evil Dead')
c. INSERT INTO ScaryMovies('Saw',103)
d. INSERT INTO (ScaryMovies) VALUES (Title 'The Omen', Minutes '111')
e. INSERT INTO ScaryMovies VALUES('Nightmare on Elm Street', 91)

f. no answer


Given the SQL table having the definition below, what will be the effect of the following
SQL statement if the server is functioning in non-strict mode? d

CREATE TABLE Cellphones(
Manufacturer VARCHAR(50) NOT NULL,
DisplayType VARCHAR(20) DEFAULT 'color',
Vibration TINYINT NOT NULL DEFAULT 1
);

INSERT INTO Cellphones VALUES();

a. the execution of the statement will produce an error because column
DisplayType is not declared NOT NULL but has a DEFAULT value
b. a new record will be inserted having the value '' (the empty string) on the
Manufacturer column
c. a new record will be inserted having the value NULL on the DisplayType
column
d. the execution of the statement will produce an error because column
Manufacturer doesn't have a default value
e. a new record will be inserted having the value 0 on the Vibration column
f. no answer



Which of the following is NOT true about a result set produced by a SELECT
statement? c

a. the result consists of a set of records whose order can be chosen by the
client
b. each column in a result set has a name
c. a result set has an associated storage engine
d. the name of each column in a result set can be automatically chosen by the
server or specified by the client
e. no answer


Which of the following is NOT a possible way of setting the sql_mode? e

a. globally, by passing options to the server's executable upon execution
b. globally, from a client session
c. globally, from the server's configuration file
d. per-session, from a client session
e. per-session, from the server's configuration file
f. no answer


Which of the following elements may participate in an expression that specifies the
value for a column returned by a SELECT statement? (choose four)a,b,d,f

a. constant values
b. operators
c. storage engines
d. table columns
e. data types
f. predefined SQL functions


Which of the following are true about the following form of the INSERT statement?
(choose two): a b

INSERT INTO MyTable VALUES('Stuff',3);

a. the order of the specified column values must match the order of the
columns in the table definition
b. the number of column values specified must match the number of columns in
the table definition
c. the statement is not valid because the list of column names is mandatory
and must follow the table name
d. the statement is not valid because, if the list of column names is not
specified, the client is not allowed to specify any values


Given an SQL table named People that contains two columns - FullName and
DateOfBirth - which of the following SELECT statements would generate a result set
having two columns named Name and DoB? (choose three)a,b,c

a. SELECT FullName AS Name, DateOfBirth DoB FROM People
b. SELECT FullName AS Name, DateOfBirth AS DoB FROM People
c. SELECT FullName Name, DateOfBirth DoB FROM People
d. SELECT Name AS FullName, DoB AS DateOfBirth FROM People
e. SELECT FullName, DateOfBirth AS Name,DoB FROM People


The INSERT statement allows the SQL client to add new records to a table in many
ways, except: e

a. by specifying no values for any columns
b. by specifying values for more than one record in a single INSERT statement
c. by specifying all the values for the new record one value each column in
the table definition
d. by specifying only the values for a few columns
e. by specifying more values than the number of columns in the table definition
f. no answer

Given an SQL table having the contents below, what will be the result returned by the
specified SELECT query?b



SELECT Name FROM People WHERE Age>12 ORDER BY Surname DESC, Name
LIMIT 1

a. dobbs
b. john
c. joanna
d. doe
e. jerry
f. brad
g. no answer

Which of the following is true about inserting new records into an SQL table if the
MySQL server is functioning in strict mode? a

a. omitting the value for a NOT NULL column whose definition doesn't specify a
default value will generate an error
b. missing columns in INSERT statements will automatically be populated with
default values chosen by the server
c. columns declared as NOT NULL will have an implicit default value of 0
d. values that are too big to fit in their column type will be truncated to the
maximum value allowed by the column type
e. no answer




What is the correct statement for deleting all the products having a price between 30
and 100 from a table named Products that has a column named Price?f

a. DELETE * FROM Products WHERE Price>30 AND Price<100
b. DELETE FROM Products(*) WHERE Price>100 OR Price <30
c. DELETE FROM Products WHERE Price<100 OR Price >30
d. DROP * FROM Products WHERE Price>30 AND Price<100
e. DELETE FROM Products(Price) WHERE Price<100 OR Price >30
f. DELETE FROM Products WHERE Price>30 AND Price<100
g. no answer


Given an SQL table named Employees that has a column named Salary which
represents the monthly salary, which of the following statements will produce a 10%
increase for annual salaries less than 10000?f

a. UPDATE Employees SET Salary=Salary*12 WHERE Salary*1.1<10000
b. UPDATE Employees SET Salary=Salary*0.9 WHERE Salary<10000
c. UPDATE Employees SET Salary=Salary*0.1 WHERE Salary<10000
d. UPDATE Employees SET Salary=Salary*1.1 WHERE Salary>10000
e. UPDATE Employees SET Salary*1.1 WHERE Salary*12<10000
f. UPDATE Employees SET Salary=Salary*1.1 WHERE Salary*12<10000
g. no answer

What SQL statement is used for changing the sql_mode? a

a. SET
b. MODE
c. CHANGE
d. MODIFY
e. UPDATE
f. ALTER
g. no answer

Which of the following are DML (Data Manipulation Language) instructions? (choose
four)a,b,c,f

a. SELECT
b. DELETE
c. UPDATE
d. DROP
e. ALTER
f. INSERT

Given an SQL table named Rectangles that contains two columns Width and Height
which of the following are correct SELECT statements that return the rectangle with the
smallest area? (choose two)a,d

a. SELECT * FROM Rectangles ORDER BY Width*Height LIMIT 1
b. SELECT * FROM Rectangles ORDER BY Width,Height DESC LIMIT 1
c. SELECT * FROM Rectangles ORDER BY Width*Height DESC LIMIT 1
d. SELECT * FROM Rectangles ORDER BY Width*Height ASC LIMIT 1
e. SELECT * FROM Rectangles ORDER BY Width+Height LIMIT 1
f. SELECT * FROM Rectangles LIMIT 1

Curs 4

1.What is the difference between a CHAR and a VARCHAR column?d

a. CHAR allows up to 16 million characters, while VARCHAR only allows up to
255 characters
b. the CHAR column may have an associated collation and character set, while
the VARCHAR column may not
c. the CHAR column may take NULL values while the VARCHAR column may
not
d. space occupied by VARCHAR values depends on the length of the values,
while CHAR values always take the amount of space specified in the table
definition
e. the VARCHAR data type is used for storing octet strings, while CHAR is
used for storing character strings
f. no answer


2.Which of the following SQL statements will correctly insert a new row into a table
created with the definition below, without generating any errors or warnings?

CREATE TABLE datatypes(c1 DATETIME, c2 DATE, c3 TIME)d

a. INSERT INTO datatypes values(2009-05-18 15:21:78, 2003-02-12,
18:33:02)
b. INSERT INTO datatypes values('2009-05-18 15:21:78', '2003-02-12', '18-33-
02')
c. INSERT INTO datatypes values('13:21:05 2009-05-18', '2008-07-25',
'11:33:22')
d. INSERT INTO datatypes values('1986-05-20 04:44:02', '1907-08-14',
'13:03:42')
e. no answer







3.What is the proper MySQL data type for a table column that stores the amount of time
that students spend learning?b

a. TIME
b. TIMESTAMP
c. YEAR
d. MICROTIME
e. DATETIME
f. DATE
g. no answer

4.What will be the set of allowed values for an SQL table column having the following
definition? e

Age INT(3) NOT NULL

a. 0...999
b. -2147483648...2147483647
c. 0...2147483647
d. 0...100
e. -999...999
f. no answer

5.What is the main difference between the FLOAT and DECIMAL MySQL data types? b

a. FLOAT is used for storing fixed-point numbers, while DECIMAL is used for
storing floating-point numbers
b. DECIMAL is used for storing fixed-point numbers, while FLOAT is used for
storing floating-point numbers
c. operations involving DECIMAL values run much faster than those involving
FLOAT values
d. valid values inserted into a DECIMAL column of a record may be
rounded/truncated, while FLOAT values store precise values
e. DECIMAL may store negative numbers, while FLOAT may not
f. no answer

6.Which of the following SQL statements will execute successfully (without warnings or
errors) and will insert the value 'yes' into the table with the definition below, if the server
is functioning in non-strict mode? e

CREATE TABLE t(e ENUM('yes','no','maybe') NOT NULL);



a. INSERT INTO t VALUES(5);
b. INSERT INTO t VALUES('yes,no');
c. INSERT INTO t VALUES(2);
d. INSERT INTO t VALUES(yes);
e. INSERT INTO t VALUES();
f. INSERT INTO t VALUES(NULL);
g. no answer

7.What will be the last value inserted on column i when executing the SQL script below?
a
CREATE TABLE t(i INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t VALUES();
INSERT INTO t VALUES();
INSERT INTO t VALUES();
DELETE FROM t WHERE i>1 AND i<3;
INSERT INTO t VALUES();

a. 4
b. 0
c. 2
d. 1
e. NULL
f. 3
g. no answer






8.Which of the following is NOT a MySQL data type for representing integers?b

a. TINYINT
b. LARGEINT
c. INT
d. MEDIUMINT
e. BIGINT
f. SMALLINT
g. no answer

9.What will be the possible range of values for the column having the definition below?
d

FLOAT (4,2) UNSIGNED

a. -9999.99...9999.99, NULL is allowed
b. 0...9999.99; NULL is not allowed
c. 0...99.99; NULL is not allowed
d. 0...99.99; NULL is allowed
e. -9999.99...9999.99; NULL is not allowed
f. -99.99...99.99; NULL is not allowed
g. no answer

10.Which of the following is NOT true regarding the SET data type?d

a. when inserting a value into a SET column, the value must be quoted as a
string, using '...' (single quotes)
b. each possible value for a SET column must be specified in the column
definition
c. each value stored in a SET column may be a combination of the possible
values specified in the column definition
d. the empty string "" is an invalid value and cannot be inserted on a SET
column
e. it is an enumerated data type
f. each value is represented internally by MySQL as an integer
g. no answer

11.Choosing a certain data type for an SQL table column will NOT influence:d

a. the amount of memory occupied by the column data
b. the storage engine of the table that contains the column
c. performance of SQL operations that implicate column values
d. the range of possible values for the column
e. no answer

12.Which of the following are differences between the DATETIME and TIMESTAMP
types? (choose three)a,c,e

a. TIMESTAMP columns may use the ON UPDATE CURRENT TIMESTAMP
modifier, while DATETIME columns may not
b. DATETIME columns may have default values while TIMESTAMP columns
may not
c. TIMESTAMP columns can take "zero date" values while DATETIME can not
d. DATETIME columns can hold values that go beyond year 2038, while
TIMESTAMP columns can not
e. TIMESTAMP columns may use the DEFAULT CURRENT_TIMESTAMP
modifier while DATETIME columns may not

13.Which of the following properties does a MySQL character string have that an octet
string doesn't? (choose two)c,e

a. maximum length
b. unsigned property
c. charset
d. auto_increment value
e. collation







14.What column modifiers may be used in an INT column definition? (choose four)bcdf

a. CHARSET
b. AUTO_INCREMENT
c. ZEROFILL
d. UNSIGNED
e. ON UPDATE CURRENT_TIMESTAMP
f. NOT NULL

15.Which of the following character sets will not provide Romanian special characters?a

a. ASCII
b. UTF8
c. latin2
d. UCS2
e. no answer

16.Which of the following is true when using character strings having the collation
utf8_bin?c

a. each character will be stored as 1 byte
b. the string 'Hans Mueller' will be considered equal to 'Hans Mller'
c. each character may take more than 1 byte of storage
d. the string 'MySQL' will be considered equal to 'mysql'
e. no answer

Anda mungkin juga menyukai