CUSTOMER_CODE SMUDE DIVISION_CODE SMUDE

advertisement
CUSTOMER_CODE
SMUDE
DIVISION_CODE
SMUDE
EVENT_CODE
JAN2016
ASSESSMENT_CODE BT0075_JAN2016
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
73281
QUESTION_TEXT
Explain any five string functions with example
SCHEME OF
EVALUATION
ASCII(str): RETURNS the numeric value of the leftmost character of the
string str. EX: SELECT ASCII(2)--- 50 (2 marks)
BIN(N): Returns a string representation of the binary value of N. EX:
SELECT BIN(12) ---- ‘1100’ (2 marks)
BIT_LENGTH(str): Returns the length of the string str in bits. EX:
SELECT BIT_LENGTH(‘text’)--------- 32 (2 marks)
CAHR(N,…): it interprets the argument as integers and returns a string
consisting of the characters given by the code values of those integers.
EX: SELECT CHAR(77,77.3,’77.3’);--MMM (2 marks)
CONCAT(str1,str2): concatenates the arguments. EX: SELECT
CONCAT(‘MY’,’S’,’Ql’); ----------- ‘MYSQL’ (2 marks)
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
73282
QUESTION_TEXT
Describe various logical operators in MySQL.
The NOT operator
The OR operator
SCHEME OF EVALUATION The XOR operator
Bit operator
Explanation(2.5 each)
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
73284
QUESTION_TEXT
Give the syntax for the following:
a. DROP USER
b. REVOKE
c. SET PASSWORD
SCHEME OF
EVALUATION
a.
DROP USER (4 marks)
as present in MySQL 5.0.0 removes only accounts that have no
privileges.
To remove a MySQL account completely (including all of its
privileges), you should use the following procedure, performing these
steps in the order shown:
1. Use to determine what privileges the account has.
2. Use to revoke the privileges displayed by . This removes rows for
the account from all the grant tables except the user table, and revokes
any global privileges listed in the user table.
3.
b.
Delete the account by using to remove the user table row.
REVOKE (3 marks)
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level
FROM user [, user] ...
REVOKE ALL PRIVILEGES, GRANT OPTION
FROM user [, user] ...
● The statement enables system administrators to revoke privileges
from MySQL accounts.
● . For example: REVOKE INSERT ON *.* FROM 'jeffrey'@'localhost'.
● To use the first syntax, you must have the privilege, and you must
have the privileges that you are revoking.
c.
SET PASSWORD (3 marks)
SET PASSWORD=PASSWORD(‘some password’)
SET PASSWORD FOR user=PASSWORD(‘some password’)
The SET PASSWORD statement assigns a password to an existing
MYSQL account.
The first syntax sets the password for the current user.
The second syntax sets the password for a specific account on the current
server host.
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
115898
What are the reasons to use MySQL? What is new in MySQL 5.1?
QUESTION_TEXT
The reasons to use MySQL:
[Any 5. 1 Mark Each. 5 x 1 Mark = 5 Marks]
SCHEME OF
EVALUATION
1.
Scalability and Flexibility:The MySQL database server provides
the ultimate in scalability, sporting the capacity to handle deeply
embedded applications with a footprint of only 1MB to run massive data
warehouses holding terabytes of information. Platform flexibility is a
stalwart feature of MySQL with all flavors of Linux, UNIX, and
Windows being supported.
2.
High Performance: A unique storage-engine architecture allows
database professionals to configure the MySQL to database server
specifically for particular applications, with the end result being amazing
performance results.
3.
High Availability: MySQL offers a variety of high-availability
options from high-speed master/slave replication configurations, to
specialized Cluster servers offering instant failover, to third party
vendors offering unique high-availability solutions for the MySQL
database server.
4.
Robust Transactional Support:MySQL offers one of the most
powerful transactional database engines on the market. Full data integrity
is also assured through server-enforced referential integrity, specialized
transaction isolation levels, and instant deadlock detection.
5.
Web and Data Warehouse Strengths:MSQL is the de-facto standard
for high-traffic web sites because of its high-performance query engine,
tremendously fast data inserts capability, and strong support for
specialized web functions like fast full text searches.
6.
Strong Data Protection:Because guarding the data assets of
corporations is the number one job of database professionals, MySQL
offers exceptional security features that ensure absolute data protection.
7.
Comprehensive Application Development:MySQL also provides
connectors and drivers (ODBC, JDBC, etc.) that allow all forms of
applications to make use of MYSQL as a preferred data management
server.
8.
Management Ease:MySQL provides a complete suite of graphical
management and migration tools that allow a DBA to manage,
troubleshoot, and control the operation of many SQL servers from a
single workstation.
9.
Open Source Freedom and 24x7 Support:MySQL is not a typical
open source project as all the software is owned and supported by
MySQL AB, and because of this, a unique cost and support model are
available that provides a unique combination of open source freedom and
trusted software with support.
10. Lowest Total Cost of Ownership:By migrating current databasedrive applications to MySQL, or using MySQL for new development
projects, corporations are realizing cost savings that many times stretch
into seven figures.
(5 Marks)
New in MySQL 5.1: The following features have been added to MySQL
5.1
[Any 5. 1 Mark Each. 5 x 1 Mark = 5 Marks]
1.
Partitioning:This capability enables distributing portions of
individual labels across a file system, according to rules which can be set
when the table is created. In effect, different portions of a table are stored
as separate tables in different locations, but from the user point of view,
the partitioned table is still a single table.
2.
Row-Based Replication: Replication capabilities in MySQL
originally were based on propagation of SQL statements from master to
slave. This is called statement-based replication. As of MySQL 5.1.5
another basis for replication is available. This is called row-based
replication, instead of sending SQL statements to the slave, the master
writes events to its binary log that indicate how individual table rows are
affected. As of MySQL 5.1.8 a third options is available; mixed. This
will use statement-based replication by default, and only switch to rowbased replication in particular cases.
3.
Plugin API: MySQL adds support for a very flexible plugin API
that enables loading and unloading of various components at runtime,
without restarting the server. This allows users to implement their own
input filter on the indexed text, enabling full-text search capability on
arbitrary data such as PDF files or other document formats.
4.
Event Scheduler: MySQL events are tasks that run according to a
schedule. When you create an event, you are creating a named database
object containing one or more SQL statements to be executed at one or
more regular intervals, beginning and ending at a specific date and time.
5.
Server Log Tables: As of MySQL 5.1, the server’s logging
capabilities are more flexible. Log entries can be written to log files or to
the general_logand slow_log tables in the MySQL databases. If logging
is enabled, either or both destinations can be selected. The –log-output
option controls the destination or destinations of log output.
6.
Upgrade Program: The MySQL_upgrade program checks all
existing tables for incompatibilities with the current version of MySQL
Server and repairs them if necessary. This program should be run for
each MySQL upgrade.
7.
MySQL Cluster: Clustering support is longer available in mainline
MySQL 5.1 releases. MySQL cluster releases are identified by a 3-part
NDT version number; currently, the MySQL Cluster NDB 6.2 and
MySQL. Cluster NDB 6.3 release series are available for production use.
(5 Marks)
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
115901
QUESTION_TEXT
Explain stored procedure and routines.
A stored procedure refers collectively to standalone stored functions,
standalone procedures, packaged functions and procedures.
Stored programs include these objects:
SCHEME OF
EVALUATION
●
Stored routines: stored functions and procedures. A stored function
is used much like a built-in function. A stored procedure is invoked
using the CALL statement. A procedure does not have a return value but
can modify its parameters later inspection by the caller. It can also
generate sets to be returned to the client program.
●
Triggers: A trigger is a named database object that is associated
with a table and that is activated when a particular event occurs for the
table, such as an insert or update.
●
Events: An event is a task that runs according to the schedule.
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
115903
QUESTION_TEXT
Explain various types of Joins.
●
SCHEME OF EVALUATION ●
●
INNER
OUTER (LEFT, RIGHT, FULL)
CROSS
Download