Showing posts with label sql server. Show all posts
Showing posts with label sql server. Show all posts

Saturday, 23 July 2011

checking data on sql through win form weather entry is added or failed or no double entry


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication8
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int flag = 0;
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection conn = new SqlConnection("server=WEBNET;database=scott;user=sa;password=aptech");
                conn.Open();
                string select = "select * from reg";
                SqlCommand comm = new SqlCommand(select, conn);
                SqlDataReader dr = comm.ExecuteReader();
                while (dr.Read())
                {
                    if (dr["rollno"].ToString() == textBox1.Text)
                    {
                        MessageBox.Show("Record already exists");
                        flag = 1;
                    }
                }
                if (textBox1.Text.Equals("") || textBox2.Text.Equals("") || textBox3.Text.Equals("") || textBox4.Text.Equals(""))
                {
                    MessageBox.Show("values cannot be empty");
                }
                else if(flag==0)
                {
                    string insert;
                    insert = "insert into reg values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')";
                    SqlCommand comm1 = new SqlCommand(insert, conn);
                    flag = 0;
                    dr.Close();
                    comm1.ExecuteNonQuery();
               
               
               
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occured");
            }
        }
       
    }
}

C# Sharp WinForm , SqlServer Adding Data Through Textbox, Radio button,Massage box


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string gender;
           
            if (radioButton1.Checked)
            {
                gender = radioButton1.Text.ToString();
            }
            else
            {
                gender = radioButton2.Text.ToString();
            }
            SqlConnection cn = new SqlConnection("server=LAB2-86;database=studentsdb;user=sa;password=aptech");
       
            string insert;
            insert = "insert into db values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + gender + "')";
            SqlCommand sc = new SqlCommand(insert, cn);
            cn.Open();
            if (MessageBox.Show("Do want to insert record? ", "Winform", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
            {
                sc.ExecuteNonQuery();
            }
            string select = "select * from db";
            SqlDataAdapter da = new SqlDataAdapter(select, cn);
            DataTable dt = new DataTable();
            da.Fill(dt);
            dataGridView1.DataSource = dt;
            cn.Close();
        }
    }
}

data grid view export data to exel


private void Excel_Click(object sender, EventArgs e)
>         {
>             if (dataGridView1.Rows.Count != 0)
>             {
>                 SaveFileDialog sfd = new SaveFileDialog();
>                 sfd.Filter = "Microsoft Excel 97/2000/XP(*.xls)|
> *.xls";
>                 sfd.FileName = "Report.xls";
>                 if (sfd.ShowDialog() == DialogResult.OK)
>                 {
>                     StreamWriter wr = new StreamWriter(sfd.FileName);
>
>                     int cols = dataGridView1.Columns.Count;
>                     for (int i = 0; i < cols; i++)
>                     {
>
> wr.Write(dataGridView1.Columns[i].Name.ToUpper() + "\t");
>                     }
>
>                     wr.WriteLine();
>
>                     for (int i = 0; i < (dataGridView1.Rows.Count -
> 1); i++)
>                     {
>                         for (int j = 0; j < cols; j++)
>                         {
>
> wr.Write(dataGridView1.Rows[i].Cells[j].Value + "\t");
>                         }
>                         wr.WriteLine();
>                     }
>                     wr.Close();
>                     label9.Text = "Your file has been successfully
> saved !";
>                 }
>             }
>             else
>             {
>                 MessageBox.Show("Error");
>             }
>         }

Another C# Sharp WinForm With Massage Box Creating Connection To SqlServer adding,delete,update Data Through Textbox


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection("server=WEBNET;database=myfirstdb;user=sa;password=aptech");
            string insert;
            insert = "insert into employee values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "' )";
            SqlCommand cm = new SqlCommand(insert,cn);
            cn.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Record added succesfully");
            cn.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection("server=WEBNET;database=myfirstdb;user=sa;password=aptech");
            string delete;
            delete = "delete from employee where empno='" + textBox1.Text + "' ";
            SqlCommand cm = new SqlCommand(delete, cn);
            cn.Open();
            cm.ExecuteNonQuery();
            cn.Close();


 private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection("server=LAB2-80;database=myfirstdb;user=sa;password=aptech");
            string update;
            update = "update emp set empno='"+textBox1.Text+"',name='"+textBox2.Text+"',location='"+textBox3.Text+"' where empno='"+textBox1.Text+"' ";
            SqlCommand cm = new SqlCommand(update, cn);
            cn.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Record updated succesfully");
            cn.Close();
        }



        }
    }
}

C# Sharp WinForm Ceating Connection To SqlServer adding,delete,update Data Through Textbox


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace mydatabase
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection sc = new SqlConnection("Server=LAB2-86;Database=ApStudents;user=sa;password=aptech");
            string insert = "insert into Students values ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')";
            SqlCommand cm = new SqlCommand(insert, sc);
            sc.Open();
            //cm.ExecuteNonQuery();
            try
            {
                cm.ExecuteNonQuery();
                MessageBox.Show("Data Insert Successfully");
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            sc.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection sc = new SqlConnection("Server=LAB2-86;Database=ApStudents;user=sa;password=aptech");
            string delete = "delete from Students where std_ID=('" + textBox1.Text + "')";
            SqlCommand cm = new SqlCommand(delete, sc);
            sc.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Data Delete Successfully");
            sc.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection sc = new SqlConnection("Server=LAB2-86;Database=ApStudents;user=sa;password=aptech");
            string update = "update Students set std_ID='" + textBox1.Text + "',S_Name='" + textBox2.Text + "',S_Address='" + textBox3.Text + "' where std_ID='" + textBox1.Text + "' ";
            SqlCommand cm = new SqlCommand(update, sc);
            sc.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Data Update Successfully");
            sc.Close();
        }
    }
}

radio button with sqldata


 private void button1_Click(object sender, EventArgs e)
        {
            string gender;
            if (radioButton1.Checked)
            {
                gender = radioButton1.Text.ToString();
            }
            else
            {
                gender = radioButton2.Text.ToString();
            }
            SqlConnection cn = new SqlConnection("server=WEBNET;database=scott;user=sa;password=aptech");
            string insert;
            insert = "insert into student values('" + textBox1.Text + "','" + textBox2.Text + "','" + gender + "')";
            SqlCommand comm = new SqlCommand(insert, cn);
            cn.Open();
            if (MessageBox.Show("Do want to insert record? ","Winform",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning)==DialogResult.OK)
            {
                comm.ExecuteNonQuery();
            }
                cn.Close();
        }

Monday, 21 March 2011

SQL Server Question and Answear


1Question : Identify the advantages of a Network Database Model.      
      
a)    The relationships are easier to implement      
b)    The databases are easy to design      
c)    The model enforces database integrity      
d)    The model achieves sufficient data independence.      
e)    All of the above      
Correct Answers : acd      //e  http://wiki.answers.com/Q/The_advantages_and_disadvantages_of_database_network_model      
2 Question : The __________ component is used to administer permissions on the databases and database objects.      
      
f)    DML      
g)    sub-schema DDL      
h)    DCL      
i)    DDL      
Correct Answers : c  
http://blog.sqlauthority.com/2008/01/15/sql-server-what-is-dml-ddl-dcl-and-tcl-introduction-and-examples/      
3 Question : Which of the following statement/s with respect to the Relational Model is/are True?      
      
j)    This model hides all the complexities of the system      
k)    This model is much faster than the other database systems      
l)    This model concentrates more on the logical view of the database rather than the physical view.      
m)    This model offers a great deal of querying flexibility      
n)    This model is very easy to handle.      
Correct Answers : acde  //in book page no 16
The fastest database modle is network database modle      
4 Question : The Entity integrity rule states that no component of the primary key of a base table should be allowed to accept NULL values. Do you agree with this statement?      
      
o)    Yes.  Because, if the primary key contains NULL values, then the rows would no longer be unique.      
p)    No.  The primary key can contain NULL values but not a zero.      
q)    Can't say.      
Correct Answers : a
Very easy      
5 Question : Statement 1:  For a column to be set as a foreign key in a given table, it must be a primary key in another table.
Statement 2: The two columns being joined by the foreign key relationships must have an identical definition.      
      
r)    Only statement 2 is True      
s)    Both the statements are True      
t)    Both the statements are False      
u)    Only statement 1 is True      
Correct Answers : b
So easy       
6 Question : Which of the following statements with respect to Referential Integrity and Foreign Keys are NOT TRUE?      
      
v)    A database must not contain more than one  unmatched foreign key value.      
w)    The attribute values in the foreign key must have a corresponding match in the relation where the attribute is a primary key.      
x)    New values cannot be introduced in a foreign key      
y)    None of the above      
Correct Answers : a      
7 Question : Who am I?
I am used for efficient searching through a database.
I am used to build online libraries      
      
z)    DML      
aa)    DCL      
bb)    CCL      
cc)    DDL      
dd)    DQL      
Correct Answers : c      
8 Question : Jack has created a database in MS ACCESS using the Database Wizard.  The database will be stored as an ______ file on the system.      
      
ee)    .db      
ff)    .rdb      
gg)    .mdb      
hh)    .dw      
Correct Answers : c      
9 Question : In MS Access, the alphanumeric data type is referred to as the 'Text' data type, and is of variable length holding a maximum of _____ characters.      
      
ii)    255      
jj)    256      
kk)    1024      
ll)    25      
Correct Answers : a      
10 Question : MS Access stores date in the _______ format.      
      
mm)    mm/dd/yy      
nn)    dd-mon-yy      
oo)    dd-mm-yy      
pp)    dd/mm/yy      
qq)    yy-mon-dd      
Correct Answers : a      
11 Question : In MS Access, the field size of a 'Text' field has a default setting of _____.      
      
rr)    10      
ss)    20      
tt)    25      
uu)    40      
vv)    50      
ww)    55      
Correct Answers : e      
12 Question : What rules are applicable when we use referential integrity in an MS Access database?      
      
xx)    We cannot enter a value in the foreign key field of the related table if it does not exist in the primary key of the primary table.      
yy)    We cannot enter a null value in the foreign key.      
zz)    We cannot change a primary key value in the primary table.      
aaa)    We cannot delete a record from a primary table, if matching records exist in a related table.      
bbb)    All of the above      
Correct Answers : acd      
15 Question : Match the field names with the kind of data types needed.
a. Patient_Name           1. Autonumber
b. Patient_ID                 2. Memo                                                                                        
c. Patient_Adm_Date     3. Text                                                                                           
d. Patient_History          4. Date/Time      
      
ccc)    a-3,b-1,c-4,d-2      
ddd)    a-4,b-3,c-1,d-2      
eee)    a-2,b-1,c-4,d-3      
fff)    a-3,b-4,c-1,d-2      
Correct Answers : a      
16 Question : Among all these versions, __________ offers a complete range  of advanced scalability and reliability options.      
      
ggg)    SQL Server 2000 Enterprise Edition      
hhh)    SQL Server 2000 Standard Edition      
iii)    SQL Server 2000 Developer Edition      
jjj)    SQL Server 2000 Desktop Edition      
kkk)    SQL Server 2000 Windows CE Edition      
Correct Answers : a      
17 Question : Microsoft Windows NT Server 4.0 Service Pack 5 or later must be installed as a minimum requirement for all SQL Server 2000 editions.  Do you agree with this statement?      
      
lll)    Yes.      
mmm)    No. SP5 must be installed as a minimum requirement only for SQL Server Enterprise Edition.      
nnn)    No. SP5 must be installed as a minimum requirement only for SQL Server Standard Edition.      
ooo)    No. You need not install any Service Pack .      
Correct Answers : a      
18 Question : Identify the Enterprise level features of SQL Server 2000.      
      
ppp)    SQL Server 2000 supports the Client/Server Model      
qqq)    SQL Server 2000 runs on Windows NT 4 and Windows 2000      
rrr)    SQL Server 2000 supports most of the popular protocols such as AppleTalk, TCP/IP.      
sss)    SQL Server 2000 supports data replication.      
ttt)    SQL Server 2000 provides several tools for building data warehouses.      
uuu)    All of the above      
Correct Answers : f      
19 Question : Identify the minimum hardware requirements for installing SQL Server 2000 and connecting to the clients.      
      
vvv)    60 MB Disk space      
www)    128 MB RAM      
xxx)    Intel compatible 32-bit CPU      
yyy)    NIC      
zzz)    95 MB Disk space      
aaaa)    256 MB RAM      
Correct Answers : bcde      
20 Question : James chooses to install SQL Server 2000 relational database with both server and client tools.  In this case, he should select :      
      
bbbb)    named instance of SQL Server 2000      
cccc)    default instance of SQL Server 2000      
dddd)    Both named and default instance of SQL Server 2000      
eeee)    Either named or default instance of SQL Server 2000      
Correct Answers : d      
21 Question : If SQL Server is using Windows Authentication, you have to provide a login ID each time you access a registered SQL Server.      
      
ffff)    TRUE      
gggg)    FALSE      
Correct Answers : b      
22 Question : Which of the following statement/s with respect to Transact-SQL is/are NOT TRUE?      
      
hhhh)    Transact-SQL allows you to declare and utilize local variables and constants within a Transact-SQL object.      
iiii)    Transact-SQL is a standalone product.      
jjjj)    One can use Transact-SQL to write applications directly      
kkkk)    Transact-SQL is the enabler of programming functionality within the relational databases.      
llll)    Transact-SQL is a set of programming extensions from Microsoft      
Correct Answers : bc      
23 Question : Unlike SQL Server 2000, MS Access maps a database over a set of operating-system files.  Data and log information are never mixed on the same file.      
      
mmmm)    TRUE      
nnnn)    FALSE      
Correct Answers : b      
24 Question : Statement 1: The Secondary data files of SQL Server 2000 database include all the data files including the primary data file.
Statement 2: There must be maximum one log file for each SQL Server 2000 database.
Statement 3: The Primary data file is the starting point of the SQL Server 2000 database.
Statement 4: Every database has one secondary data file
      
      
oooo)    Statement 1 is True
pppp)    Statement 2 is False
qqqq)    Statement 3 is True
rrrr)    Statement 4 is False      
ssss)    Statement 1 is False
tttt)    Statement 2 is True
uuuu)    Statement 3 is False
vvvv)    Statement 4 is True      
wwww)    Statement 1 is False
xxxx)    Statement 2 is False
yyyy)    Statement 3 is True
zzzz)    Statement 4 is True      
aaaaa)    Statement 1 is False
bbbbb)    Statement 2 is False
ccccc)    Statement 3 is True
ddddd)    Statement 4 is False      
eeeee)    Statement 1 is False
fffff)    Statement 2 is False
ggggg)    Statement 3 is False
hhhhh)    Statement 4 is False      
iiiii)          
Correct Answers : d      
25 Question : What command will you give, to set the 'emp' database file eligible for automatic periodic shrinking?      
      
jjjjj)    EXEC sp_adoption 'emp', autoshrink, true      
kkkkk)    EXEC sp_adoption 'emp', autoshrink, Yes      
lllll)    EXECUTE sp_adoption 'emp', autoshrink, Yes      
mmmmm)    EXE  'emp', autoshrink, true      
Correct Answers : a      
26 Question : What will the following command do?
DBCC SHRINKDATABASE(PUBS, 10)
      
      
nnnnn)    It will decrease the size of files in 'Pubs' database to allow 10 percent free space      
ooooo)    It will decrease the size of files in 'Pubs' database 10 times its current size      
ppppp)    It will decrease the size of files in 'Pubs' database to allow 90 percent free space      
qqqqq)    It will decrease the size of 10 files in 'Pubs' database      
Correct Answers : a      
27 Question : What role does the SQL Server Enterprise Manager play?      
      
rrrrr)    It allows users to define groups of servers running SQL Server 2000      
sssss)    It registers individual servers in a group      
ttttt)    It configures all SQL Server 2000 options for each registered server      
uuuuu)    It creates and administers all SQL Server 2000 databases, objects, logins, users, and permissions in each registered sever.      
Correct Answers : abcd      
28 Question : Which of the following statements with respect to the autoshrink feature of SQL Server 2000 are True?      
      
vvvvv)    When using SQL Server Enterprise Edition, the Autoshrink option is set to True      
wwwww)    When using SQL Server Desktop Edition, the Autoshrink option is set to False      
xxxxx)    The autoshrink option is set to False for all other editions regardless of the operation system except for the SQL Server Standard Edition      
yyyyy)    It is not possible to shrink a read-only database      
Correct Answers : d      
29 Question : Can we say that two Nulls are equal?      
      
zzzzz)    Yes      
aaaaaa)    No      
Correct Answers : b      
30 Question : What are the characteristics of a normalized database?      
      
bbbbbb)    There must be no repeating fields      
cccccc)    Each table must contain information about a single entity      
dddddd)    Each table must have a key field      
eeeeee)    Each field in a table must depend on the key field      
ffffff)    All non-key fields must be mutually dependent.      
gggggg)    All of the above      
Correct Answers : abcd      
31 Question : Donald is confused as to when he should use Normalization.  What is your advice to him?      
      
hhhhhh)    Use Normalization when the data is large and scattered      
iiiiii)    Use Normalization when the data is too complicated      
jjjjjj)    Use Normalization when there is a defined group of data      
kkkkkk)    Use Normalization as the first step to build the database application      
Correct Answers : abd      
32 Question : Identify the SQL Server 2000 tools available for enforcing Domain integrity.      
      
llllll)    DEFAULT definition      
mmmmmm)    PRIMARY key constraint      
nnnnnn)    FOREIGN key constraint      
oooooo)    CHECK constraint      
pppppp)    NOT NULL property      
qqqqqq)    UNIQUE CONSTRAINT      
Correct Answers : acde      
Question : ____________ enforces restrictions on the values entered for a particular column.      
      
rrrrrr)    Entity integrity      
ssssss)    Domain integrity      
tttttt)    User-defined integrity      
uuuuuu)    Referential integrity      
Correct Answers : b      
33 Question : Rules, Stored Procedures and Triggers are SQL Server Tools for enforcing _______________ Integrity.      
      
vvvvvv)    Entity      
wwwwww)    Domain      
xxxxxx)    User-defined      
yyyyyy)    Referential      
Correct Answers : d      
34 Question : Statement 1: If we have an option of choosing from a simple primary key and a composite key to be a primary key, we need to select the simple primary key.
Statement 2: Manipulating a single column is faster than manipulating multiple columns.      
      
zzzzzz)    Both the statements are True and statement 2 is the reason for statement 1 being True      
aaaaaaa)    Both the statements are True but statement 2 is not the reason for statement 1 being True      
bbbbbbb)    Only statement 2 is True.      
ccccccc)    Both the statements are False      
Correct Answers : a      
35 Question : A primary key constraint cannot be deleted if it is being referenced by a foreign key constraint in another table; the foreign key constraint must be deleted first.      
      
ddddddd)    TRUE      
eeeeeee)    FALSE      
Correct Answers : a      
36 Question : Which of the following statements with respect to UNIQUE constraint are True?      
      
fffffff)    A UNIQUE constraint is used when we want to enforce the uniqueness of a column that is not the primary key      
ggggggg)    Only one UNIQUE key constraint can be defined on a table.      
hhhhhhh)    A UNIQUE constraint can be referenced by a FOREIGN key constraint.      
iiiiiii)    UNIQUE constraints can be defined on columns that allow null values      
Correct Answers : acd      
Question : By default, the starting value set by the IDENTITY property is _______.      
      
jjjjjjj)    TRUE      
kkkkkkk)    FALSE      
lllllll)    0      
mmmmmmm)    1      
nnnnnnn)    -1      
Correct Answers : d      
37 Question : Alex has deleted the 'emp' table from the database.  He would now like to retrieve the structural definition of the table.  Does SQL Server 2000, allow him to do this?      
      
ooooooo)    Yes.  When a table is deleted from the database, the data and indexes if any are permanently deleted from the database but the structural definition remains intact.      
ppppppp)    No.  When a table is deleted from the database, the structural definition, data, full-text indexes, constraints, and indexes are permanently deleted from the database.      
qqqqqqq)    Can't say. If the DROP table command included an option to restore the structural definition, then it can be retrieved even after the table is permanently deleted.      
rrrrrrr)    Yes.  When a table is deleted from the database, all the data is lost but the table structure and its column constraints, indexes and so on are intact.      
Correct Answers : b      
38 Question : Statement 1: A FOREIGN key constraint has to be linked only to a column with PRIMARY KEY constraint in another table.
Statement 2: A FOREIGN key constraint can be defined to refer to columns with the UNIQUE constraint in another table.      
      
sssssss)    Only statement 1 is True      
ttttttt)    Only statement 2 is True      
uuuuuuu)    Both the statements are True      
vvvvvvv)    Both the statements are False      
Correct Answers : b      
39 Question : When a CHECK constraint is added to an existing table, the CHECK constraint by default is applied to existing data as well as new data.      
      
wwwwwww)    TRUE      
xxxxxxx)    FALSE      
Correct Answers : a      
40 Question : When more than one logical operator is used in a statement, ______ is evaluated first, then ________, and finally _______.      
      
yyyyyyy)    AND, OR, NOT      
zzzzzzz)    OR, NOT, AND      
aaaaaaaa)    NOT, AND, OR      
bbbbbbbb)    NOT, OR, AND      
cccccccc)    AND, NOT, OR      
dddddddd)    OR, AND, NOT      
Correct Answers : c      
41 Question : Statement 1: Inner Joins eliminate the rows that do not match with a row  from the other table.
Statement 2: Outer Joins, return all rows from atleast one of the tables mentioned in the FROM clause, as along as those rows meet any WHERE or HAVING search conditions of the SELECT statement.      
      
eeeeeeee)    Only statement 1 is True      
ffffffff)    Only statement 2 is True      
gggggggg)    Both the statements are True      
hhhhhhhh)    Both the statements are False      
Correct Answers : c      
41 Question : What will happen, if there are records in other tables linked to the records being deleted?      
      
iiiiiiii)    The deletion will not take place.      
jjjjjjjj)    The records from the current table will be deleted.      
kkkkkkkk)    The records from the current table as well as the linked records will be deleted.      
Correct Answers : a      
42 Question : What command must Sam use to delete all the rows from a table.      
      
llllllll)    DROP table      
mmmmmmmm)    DELETE ROWS      
nnnnnnnn)    DELETE TABLE      
oooooooo)    TRUNCATE TABLE      
Correct Answers : d      
43 Question : The Create Table statement belongs to the ___ category of SQL statements .      
      
pppppppp)    DML      
qqqqqqqq)    DCL      
rrrrrrrr)    CCL      
ssssssss)    DDL      
tttttttt)    DQL      
Correct Answers : d      
44 Question : Which SQL statement will return all items like chocolates, chocopie etc.      
      
uuuuuuuu)    Select * from eatables where item_desc LIKE CHOCO*"      
vvvvvvvv)    Select  from eatables where item_desc = CHOCO%"      
wwwwwwww)    Select * from eatables where item_desc LIKE CHOCO%"      
xxxxxxxx)    Select * from eatables where item_desc LIKE %CHOCO?"      
Correct Answers : c      
45 Question : You want to check what will be the salary of all employees, if their basic is increased by 10%. What SQL statement will show you this result ?      
      
yyyyyyyy)    Select emp_code, basic*.10 from employee order by emp_code      
zzzzzzzz)    Select emp_code, basic+basic*.01 from employee order by emp_code      
aaaaaaaaa)    Select emp_code, basic+10 from employee order by emp_code      
bbbbbbbbb)    Select emp_code, basic+basic*.10 from employee order by emp_code      
Correct Answers : d      
46 Question : Identify the query which will increase the cost of all books by about 10%.      
      
ccccccccc)    UPDATE BookDetails SET Book_Price*10/100;      
ddddddddd)    UPDATE BookDetails SET Book_Price=Book_Price*10/100;      
eeeeeeeee)    UPDATE Book_Price=Book_Price+Book_Price*10/100 FROM BookDetails;      
fffffffff)    UPDATE BookDetails SET Book_Price=Book_Price+Book_Price*10/100;      
Correct Answers : d      
47 Question : 1. A key which qualifies to be a Primary Key is called a Secondary Key.                                 
2. A Candidate key, which is not used as a Primary Key is called an Alternate Key.
      
      
ggggggggg)    1 is true      
hhhhhhhhh)    1 is false      
iiiiiiiii)    2 is true      
jjjjjjjjj)    2 is false      
kkkkkkkkk)          
lllllllll)          
Correct Answers : bc      
48 Question : __________ ensures that relationships defined between tables are valid and accidental deletion or modification of related data is not possible.      
      
mmmmmmmmm)    Entity integrity      
nnnnnnnnn)    Domain integrity      
ooooooooo)    User-defined integrity      
ppppppppp)    Referential integrity      
qqqqqqqqq)          
rrrrrrrrr)          
Correct Answers : b      
49 Question : The SQL statement - "SELECT name, id, mks from Student, Marks where student.id(+)=Marks.id "  ....is an example of ___ Join.      
      
sssssssss)    Inner      
ttttttttt)    Outer      
uuuuuuuuu)    Self      
vvvvvvvvv)          
wwwwwwwww)          
xxxxxxxxx)          
Correct Answers : b      
50 Question : To view only those records from ‘Student’ table, where regis_dt field value is in between 10/02/2004 and 12/02/2004, then the following SQL statement can be used:      
      
yyyyyyyyy)    SELECT * FROM Student
zzzzzzzzz)     WHERE regis_dt
aaaaaaaaaa)     BETWEEN "10/02/2004" AND "12/02/2004";      
bbbbbbbbbb)    SELECT * FROM Student                                                                         WHERE regis_dt
cccccccccc)    BETWEEN #10/02/2004# AND #12/02/2004#;      
dddddddddd)    SELECT * FROM Student                                                                         WHERE regis_dt
eeeeeeeeee)    NOT BETWEEN #10/02/2004# AND #12/02/2004#;      
ffffffffff)          
gggggggggg)          
hhhhhhhhhh)          
Correct Answers : b      
51 Question : Which one of the following SQL statements will display the maximum marks achieved by a student, subject wise?      
      
iiiiiiiiii)    SELECT Student_Name,Student_Subject, Max(Marks)FROM Student_Acads
jjjjjjjjjj)    GROUP BY Student_Subject      
kkkkkkkkkk)    SELECT Student_Subject, FROM Student_Acads
llllllllll)    GROUP BY Student_Subject WHERE Max(Marks)      
mmmmmmmmmm)    SELECT Student_Subject, Max(Marks)FROM Student_Acads
nnnnnnnnnn)    GROUP BY Student_Subject      
oooooooooo)    SELECT Student_Subject, Max(Marks)FROM Student_Acads
pppppppppp)    WHERE Mac(Marks) GROUP BY Student_Subject      
qqqqqqqqqq)          
rrrrrrrrrr)          
Correct Answers : c      
52 Question : Which one of the following SQL statements returns the name of the employee receiving the maximum salary in a particular department ?      
      
ssssssssss)    SELECT Emp_Name,Dep_Code,Salary
tttttttttt)    FROM Employee
uuuuuuuuuu)    WHERE Employee.Salary = (Select Max(Salary) from Employee GROUP BY Dep_Code);      
vvvvvvvvvv)    SELECT Emp_Name,Dep_Code,Salary
wwwwwwwwww)    FROM Employee
xxxxxxxxxx)    WHERE Employee.Salary In (Select Max(Salary) from Employee GROUP BY Dep_Code HAVING Max(Salary));      
yyyyyyyyyy)    SELECT Emp_Name,Dep_Code,Salary
zzzzzzzzzz)    FROM Employee
aaaaaaaaaaa)    WHERE Employee.Salary In (Select Max(Salary) from Employee GROUP BY Dep_Code);      
bbbbbbbbbbb)    SELECT Emp_Name,Dep_Code,Salary
ccccccccccc)    FROM Employee
ddddddddddd)    WHERE Employee.Salary In (Select Salary from Employee GROUP BY Dep_Code HAVING Max(Salary));      
eeeeeeeeeee)          
fffffffffff)          
Correct Answers : c      
53 Question : The following SQL statement returns the total number of employees in a Company :      
      
ggggggggggg)    Select count(Emp_Code) from Employee      
hhhhhhhhhhh)    Select sum(Emp_Code) from Employee      
iiiiiiiiiii)    Select max(Emp_Code) from Employee      
jjjjjjjjjjj)    Select Emp_Code from Employee where count(employee) >0      
kkkkkkkkkkk)          
lllllllllll)          
Correct Answers : a      
Question : What do you understand by database design?      
      
mmmmmmmmmmm)    The process of planning and structuring data objects along with the relationships among them (if any) within a database      
nnnnnnnnnnn)    A design sub activity involving the design of the conceptual, logical, and physical structure of one or more databases.
ooooooooooo)          
ppppppppppp)    The formal process of analyzing facts about the real world into a structured database model.      
qqqqqqqqqqq)    All of the above      
rrrrrrrrrrr)          
sssssssssss)          
Correct Answers : d      
54 Question : A table that tracks sales transactions will commonly have a link to the customers table so that the complete customer information can be associated with the sales transaction.  Such type of information is stored in which type of columns of a table in the database ?      
      
ttttttttttt)    Identifier columns      
uuuuuuuuuuu)    Relational or referential columns      
vvvvvvvvvvv)    Categorical columns      
wwwwwwwwwww)    Raw data columns      
xxxxxxxxxxx)          
yyyyyyyyyyy)          
Correct Answers : b      
55 Question : The Entity Relationship Diagram (E-R diagram), is a modeling tool for ______________.      
      
zzzzzzzzzzz)    Logical database design      
aaaaaaaaaaaa)    Physical Database design      
bbbbbbbbbbbb)    Conceptual Database design      
cccccccccccc)          
dddddddddddd)          
eeeeeeeeeeee)          
Correct Answers : a      
Question : Identify the ERD symbol used to represent entity sets.      
      
ffffffffffff)    Diamonds      
gggggggggggg)    Ellipses      
hhhhhhhhhhhh)    Rectangle      
iiiiiiiiiiii)    Squares      
jjjjjjjjjjjj)          
kkkkkkkkkkkk)          
Correct Answers : c      
56 Question : What benefits can be achieved by converting data into normalized form?      
      
llllllllllll)    Reduce a database structure to its simplest form      
mmmmmmmmmmmm)    Identify all data that is dependent on other data      
nnnnnnnnnnnn)    Remove redundant columns from tables      
oooooooooooo)    All of the above      
Correct Answers : d      
Question : Normalization is the process of converting an arbitrary relational database design into one that will have "good" operational properties      
      
pppppppppppp)    TRUE      
qqqqqqqqqqqq)    FALSE      
Correct Answers : a      
57 Question : When is a relation said to be in the Second Normal Form (2NF)?      
      
rrrrrrrrrrrr)    If and only if all underlying domains contain atomic values      
ssssssssssss)    If it is in 1NF and every non-key attribute is fully dependent on each foreign key of the relation.      
tttttttttttt)    If every non-key attribute of R is non-transitively dependent on each candidate key of R.      
uuuuuuuuuuuu)    If it is in 1NF and every non-key attribute is fully dependent on each candidate key of the relation      
Correct Answers : d      
58 Question : What is the difference between Joins and Unions ?      
      
vvvvvvvvvvvv)    Unions combine rows from multiple data tables, while Joins combine columns from multiple data tables.
wwwwwwwwwwww)          
xxxxxxxxxxxx)    Unions combine columns from multiple data tables, while Joins combine rows from multiple data tables.
yyyyyyyyyyyy)          
zzzzzzzzzzzz)    There is no such difference between Joins and Unions.      
Correct Answers : a      
59 Question : The __________ and __________ clause can be used to generate aggregate totals.      
      
aaaaaaaaaaaaa)    COMPUTE      
bbbbbbbbbbbbb)    CALCULATE      
ccccccccccccc)    COMPUTE BY      
ddddddddddddd)    CALCULATE BY      
eeeeeeeeeeeee)    AGGREGATE      
Correct Answers : a,c      
60 Question : By default, the UNION operator doesn't remove duplicates from the result set.      
      
fffffffffffff)    TRUE      
ggggggggggggg)    FALSE      
Correct Answers : b      
61 Question : What is the SQL syntax for selecting only a few columns from a table?      
      
hhhhhhhhhhhhh)    SELECT  <COLUMN1>, <COLUMN2>… From  <Table Name>      
iiiiiiiiiiiii)    SELECT * FROM <Table_name>      
jjjjjjjjjjjjj)    SELECT  <COLUMN1>, <COLUMN2>,....      
Correct Answers : a      
62 Question : The SELECT statement can be used to populate the result of a query into another table.      
      
kkkkkkkkkkkkk)    TRUE      
lllllllllllll)    FALSE      
Correct Answers : b      
Question : How many rows can be returned by a subquery without generating an error?      
      
mmmmmmmmmmmmm)    Only one.      
nnnnnnnnnnnnn)    Only one unless preceded by the ANY, ALL, EXISTS, or IN operators      
ooooooooooooo)    Unlimited      
ppppppppppppp)    Unlimited unless, preceded by the ANY, ALL, EXISTS or IN operators      
Correct Answers : d      
63 Question : We can use a subquery as a replacement for a value in the SELECT clause, as a part of WHERE clause.      
      
qqqqqqqqqqqqq)    TRUE      
rrrrrrrrrrrrr)    FALSE      
Correct Answers : a      
64 Question : !=, <>, ^= all denote the same operation in SQL.      
      
sssssssssssss)    TRUE      
ttttttttttttt)    FALSE      
Correct Answers : a      
65 Question : Which one of the following keywords indicates the end of a SQL batch?
      
      
uuuuuuuuuuuuu)    Go      
vvvvvvvvvvvvv)    End      
wwwwwwwwwwwww)    STOP      
xxxxxxxxxxxxx)    TERMINATE      
yyyyyyyyyyyyy)    No such keyword is used      
Correct Answers : a      
66 Question : When running a SELECT query, how do you select each DISTINCT element?      
      
zzzzzzzzzzzzz)    Add the keyword DISTINCT after SELECT.      
aaaaaaaaaaaaaa)    Add the keyword DISTINCT before SELECT.      
bbbbbbbbbbbbbb)    Add the keyword DISTINCT after WHERE.      
cccccccccccccc)    Add the keyword DISTINCT after FROM.      
Correct Answers : c      
67 Question : Refer to the given query:
SELECT product_id FROM order_items
UNION
SELECT product_id FROM inventories;
Which of the following is true?      
      
dddddddddddddd)    There are syntax errors      
eeeeeeeeeeeeee)    Only distinct rows that appear in either result are returned       
ffffffffffffff)    All the rows in the result are returned      
gggggggggggggg)    No output      
Correct Answers : b      
68 Question : When can you place a index on a view?      
      
hhhhhhhhhhhhhh)    When you only DELETE from the view      
iiiiiiiiiiiiii)    When you only SELECT from the view      
jjjjjjjjjjjjjj)    When there is a WITH CHECK OPTION used to create the view      
kkkkkkkkkkkkkk)    When you can UPDATE using the view      
llllllllllllll)    You cannot place a index on the view      
Correct Answers : e      
69 Question : What is the default length of a CHAR column?      
      
mmmmmmmmmmmmmm)    2 bytes      
nnnnnnnnnnnnnn)    8 bytes      
oooooooooooooo)    1 byte      
pppppppppppppp)    4 bytes      
Correct Answers : c      
70 Question : Which of the following clauses are mandatory in a SQL query?      
      
qqqqqqqqqqqqqq)    SELECT      
rrrrrrrrrrrrrr)    WHERE      
ssssssssssssss)    HAVING      
tttttttttttttt)    FROM      
Correct Answers : a,d      
71 Question : Where all can you use SQL expressions?      
      
uuuuuuuuuuuuuu)    In the condition of the WHERE clause and the HAVING clause      
vvvvvvvvvvvvvv)    In the VALUES clause of the INSERT statement      
wwwwwwwwwwwwww)    In the SET clause of the UPDATE statement      
xxxxxxxxxxxxxx)    In the select list of the SELECT statement      
yyyyyyyyyyyyyy)          
zzzzzzzzzzzzzz)          
Correct Answers : a,b,c,d      
72 Question : Partitioned tables are preferable over partition views in most operational environments.      
      
aaaaaaaaaaaaaaa)    TRUE      
bbbbbbbbbbbbbbb)    FALSE      
ccccccccccccccc)    TRUE: Only when the base tables are empty      
ddddddddddddddd)          
eeeeeeeeeeeeeee)          
fffffffffffffff)          
Correct Answers : a      
73 Question : Which of the following clauses may use a Temporary Tablespace?      
      
ggggggggggggggg)    UNION ALL clause      
hhhhhhhhhhhhhhh)    SELECT DISTINCT Clause      
iiiiiiiiiiiiiii)    INNER JOIN      
jjjjjjjjjjjjjjj)    GROUP BY clause      
kkkkkkkkkkkkkkk)          
lllllllllllllll)          
Correct Answers : b,c,d      
74 Question : What is the purpose of the IN operator?      
      
mmmmmmmmmmmmmmm)    Compare two similar values.      
nnnnnnnnnnnnnnn)    Restrict results to a specified list of values.      
ooooooooooooooo)    Perform an equality comparison.      
ppppppppppppppp)    Evaluate a range of values.      
qqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrr)          
Correct Answers : b      
75 Question : Which of the following commands can you use to define the name and structure of the cursor together with the SELECT statement that will populate the cursor with your data?      
      
sssssssssssssss)    FETCH      
ttttttttttttttt)    OPEN      
uuuuuuuuuuuuuuu)    DECLARE      
vvvvvvvvvvvvvvv)    CLOSE      
wwwwwwwwwwwwwww)          
xxxxxxxxxxxxxxx)          
Correct Answers : c      
76 Question : SQL statements with the HAVING clause:      
      
yyyyyyyyyyyyyyy)    Must include the GROUP BY clause      
zzzzzzzzzzzzzzz)    Must exclude the GROUP BY clause.      
aaaaaaaaaaaaaaaa)    May or may not include the GROUP BY clause.      
bbbbbbbbbbbbbbbb)          
cccccccccccccccc)          
dddddddddddddddd)          
Correct Answers : c      
77 Question : To write a query that performs an outer join on tables A and B and returns all rows from A, you are actually about to write:      
      
eeeeeeeeeeeeeeee)    A left outer join      
ffffffffffffffff)    An inner join      
gggggggggggggggg)    A right outer join      
hhhhhhhhhhhhhhhh)    An equijoin      
iiiiiiiiiiiiiiii)          
jjjjjjjjjjjjjjjj)          
Correct Answers : a      
78 Question : Which of the following is executed automatically?      
      
kkkkkkkkkkkkkkkk)    Procedure      
llllllllllllllll)    Anonymous PL/SQL block      
mmmmmmmmmmmmmmmm)    Function      
nnnnnnnnnnnnnnnn)    Trigger      
oooooooooooooooo)          
pppppppppppppppp)          
Correct Answers : d      
79 Question : Identify the SELECT statement which returns all the ‘Names’ in the Accounts table containing the alphabet ‘e’, but not as the first letter.      
      
qqqqqqqqqqqqqqqq)    SELECT * FROM Accounts WHERE Names LIKE ‘e’      
rrrrrrrrrrrrrrrr)    SELECT Name FROM Accounts WHERE Name LIKE ‘%e’      
ssssssssssssssss)    SELECT * FROM Accounts WHERE Name LIKE ‘&e’      
tttttttttttttttt)    SELECT * FROM Accounts WHERE Name LIKE ‘%e%’      
uuuuuuuuuuuuuuuu)    SELECT Name FROM Accounts WHERE Name LIKE ‘[^e]%e%’      
vvvvvvvvvvvvvvvv)          
Correct Answers : e      
80 Question : There is a table Student, which has a field studentname containing names of students. Identify the wildcard used to retrieve names of students, which don’t start within the range of e-g.      
      
wwwwwwwwwwwwwwww)    [e-g]%      
xxxxxxxxxxxxxxxx)    [e^g]%      
yyyyyyyyyyyyyyyy)    [^e-g]%      
zzzzzzzzzzzzzzzz)    [efg]%      
aaaaaaaaaaaaaaaaa)    [^efg]%      
bbbbbbbbbbbbbbbbb)          
Correct Answers : c      
81 Question : We have a table 'SSC_Result' that contains fields like student_name, Marks, Sub, School_Name. Construct a query to display the school_Name and the marks of those who have scored maximum marks in Maths.      
      
ccccccccccccccccc)    SELECT MAX (Marks), School_Name, Student_Name FROM SSC_Result WHERE sub = 'Maths' GROUP BY School_Name      
ddddddddddddddddd)    SELECT MAX (Marks), School_Name FROM SSC_Result WHERE sub = 'Maths' GROUP BY School_Name      
eeeeeeeeeeeeeeeee)    SELECT Marks(Max), School_Name, Student_Name FROM SSC_Result WHERE sub = 'Maths' GROUP BY School_Name      
fffffffffffffffff)          
ggggggggggggggggg)          
hhhhhhhhhhhhhhhhh)          
Correct Answers : b      
82 Question : A Trigger cannot be fired with the ____ SQL command.      
      
iiiiiiiiiiiiiiiii)    update      
jjjjjjjjjjjjjjjjj)    drop      
kkkkkkkkkkkkkkkkk)    delete      
lllllllllllllllll)    insert      
mmmmmmmmmmmmmmmmm)          
nnnnnnnnnnnnnnnnn)          
Correct Answers : b      
83 Question : SQL Server automatically creates an index for:      
      
ooooooooooooooooo)    Foreign key      
ppppppppppppppppp)    Primary key      
qqqqqqqqqqqqqqqqq)    Unique key      
rrrrrrrrrrrrrrrrr)    Default key      
sssssssssssssssss)          
ttttttttttttttttt)          
Correct Answers : b,c      
84 Question : Which of the following statement/s with respect to the Primary key is/are TRUE?      
      
uuuuuuuuuuuuuuuuu)    Primary key does not take null values.      
vvvvvvvvvvvvvvvvv)    All fields marked with primary keys can be unique keys but all unique keys are not primary keys.      
wwwwwwwwwwwwwwwww)    We can have only one primary key for a table.      
xxxxxxxxxxxxxxxxx)    Primary key uses unique key for making relationships      
yyyyyyyyyyyyyyyyy)          
zzzzzzzzzzzzzzzzz)          
Correct Answers : a,c      
85 Question : Which one of the following should be removed to transform a relation from the first normal form to the second normal form ?      
      
aaaaaaaaaaaaaaaaaa)    All partial-key dependencies      
bbbbbbbbbbbbbbbbbb)    All inverse partial-key dependencies      
cccccccccccccccccc)    All repeating groups      
dddddddddddddddddd)    All transitive dependencies      
eeeeeeeeeeeeeeeeee)          
ffffffffffffffffff)          
Correct Answers : a      
86 Question : Which of the following statement/s with respect to the count(*) function is/are TRUE?      
      
gggggggggggggggggg)    It can be used with  parameters      
hhhhhhhhhhhhhhhhhh)    It returns the number of unique rows, if used  with the Distinct keyword      
iiiiiiiiiiiiiiiiii)    It returns rows having null values      
jjjjjjjjjjjjjjjjjj)    It doesn't return rows having null values      
kkkkkkkkkkkkkkkkkk)          
llllllllllllllllll)          
Correct Answers : c      
Question : Views are dropped when corresponding table/s is/are dropped.      
      
mmmmmmmmmmmmmmmmmm)    TRUE      
nnnnnnnnnnnnnnnnnn)    FALSE      
oooooooooooooooooo)          
pppppppppppppppppp)          
qqqqqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrrrrr)          
Correct Answers : b      
87 Question : Choose the SELECT statement to display the name of the employee who belongs to the computer department and whose salary is greater than Rs.5000.      
      
ssssssssssssssssss)    Select emp_name from emp where dept = 'Computer' and sal >5000      
tttttttttttttttttt)    Select emp_name from emp where dept = 'Computer'  or sal >5000      
uuuuuuuuuuuuuuuuuu)    Select * from emp where dept like 'C%' or sal like > 5000      
vvvvvvvvvvvvvvvvvv)    Select * from emp      
wwwwwwwwwwwwwwwwww)          
xxxxxxxxxxxxxxxxxx)          
Correct Answers : a      
Question : Identify the query to compute the total number of rows present in the emp table.      
      
yyyyyyyyyyyyyyyyyy)    Select rowcount from emp      
zzzzzzzzzzzzzzzzzz)    Select totalrows from emp      
aaaaaaaaaaaaaaaaaaa)    Select count(*) from emp      
bbbbbbbbbbbbbbbbbbb)    Select count_rows from emp      
ccccccccccccccccccc)          
ddddddddddddddddddd)          
Correct Answers : c      
88 Question : Which trigger is used to enforce referential integrity?      
      
eeeeeeeeeeeeeeeeeee)    Instead of trigger      
fffffffffffffffffff)    Cascading trigger      
ggggggggggggggggggg)    Update trigger      
hhhhhhhhhhhhhhhhhhh)    Nested trigger      
iiiiiiiiiiiiiiiiiii)          
jjjjjjjjjjjjjjjjjjj)          
Correct Answers : b      
Question : What is the return type of a stored procedure in SQL Server 2000?      
      
kkkkkkkkkkkkkkkkkkk)    Integer      
lllllllllllllllllll)    Character      
mmmmmmmmmmmmmmmmmmm)    Boolean      
nnnnnnnnnnnnnnnnnnn)          
ooooooooooooooooooo)          
ppppppppppppppppppp)          
Correct Answers : a      
89 Question : Which one of the following SQL statements will you use to return the minimum and maximum salary from the employee table?      
      
qqqqqqqqqqqqqqqqqqq)    Select min(sal) and max(sal) from emp      
rrrrrrrrrrrrrrrrrrr)    Select min(sal) , max(sal) from emp Group by sal      
sssssssssssssssssss)    Select min(sal),max(sal) from emp      
ttttttttttttttttttt)          
uuuuuuuuuuuuuuuuuuu)          
vvvvvvvvvvvvvvvvvvv)          
Correct Answers : c      
90 Question : The _______ function in SQL Server returns the current date.      
      
wwwwwwwwwwwwwwwwwww)    getdate()      
xxxxxxxxxxxxxxxxxxx)    now()      
yyyyyyyyyyyyyyyyyyy)    date()      
zzzzzzzzzzzzzzzzzzz)    currentdate()      
aaaaaaaaaaaaaaaaaaaa)          
bbbbbbbbbbbbbbbbbbbb)          
Correct Answers : a      
91 Question : We can use the Alter table command to drop the constraint from a table.      
      
cccccccccccccccccccc)    TRUE      
dddddddddddddddddddd)    FALSE      
eeeeeeeeeeeeeeeeeeee)          
ffffffffffffffffffff)          
gggggggggggggggggggg)          
hhhhhhhhhhhhhhhhhhhh)          
Correct Answers : a      
92 Question : The ________ function is used to compute the square of a number.      
      
iiiiiiiiiiiiiiiiiiii)    POWER      
jjjjjjjjjjjjjjjjjjjj)    SQUARE      
kkkkkkkkkkkkkkkkkkkk)    SQR      
llllllllllllllllllll)    POW      
mmmmmmmmmmmmmmmmmmmm)          
nnnnnnnnnnnnnnnnnnnn)          
Correct Answers : a      
93 Question : What is the return type of the query given below?
SELECT SIGN(0)      
      
oooooooooooooooooooo)    0      
pppppppppppppppppppp)    1      
qqqqqqqqqqqqqqqqqqqq)    -1      
rrrrrrrrrrrrrrrrrrrr)          
ssssssssssssssssssss)          
tttttttttttttttttttt)          
Correct Answers : a      
94 Question : Pick the odd one out:(all are system functions)      
      
uuuuuuuuuuuuuuuuuuuu)    DB_ID      
vvvvvvvvvvvvvvvvvvvv)    DB_NAME      
wwwwwwwwwwwwwwwwwwww)    DB_SID      
xxxxxxxxxxxxxxxxxxxx)    SUSER_SID      
yyyyyyyyyyyyyyyyyyyy)    SUSER_ID      
zzzzzzzzzzzzzzzzzzzz)    SUSER_SNAME      
Correct Answers : c      
95 Question : To write a query that performs an outer join on tables A and B and returns all rows from A, you need to apply the outer join operator to all columns of table ______ in the join condition in the WHERE clause.      
      
aaaaaaaaaaaaaaaaaaaaa)    A      
bbbbbbbbbbbbbbbbbbbbb)    B      
ccccccccccccccccccccc)    A and B      
ddddddddddddddddddddd)          
eeeeeeeeeeeeeeeeeeeee)          
fffffffffffffffffffff)          
Correct Answers : b      
96 Question : What type of relationship exists between employees and the department?      
      
ggggggggggggggggggggg)    one to one      
hhhhhhhhhhhhhhhhhhhhh)    one to many      
iiiiiiiiiiiiiiiiiiiii)    many to one      
jjjjjjjjjjjjjjjjjjjjj)    many to many      
kkkkkkkkkkkkkkkkkkkkk)          
lllllllllllllllllllll)          
Correct Answers : c      
Question : Which of the following is present in the oval symbol in an ERD?      
      
mmmmmmmmmmmmmmmmmmmmm)    Entity      
nnnnnnnnnnnnnnnnnnnnn)    Attribute      
ooooooooooooooooooooo)    Process      
ppppppppppppppppppppp)    Data store      
qqqqqqqqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrrrrrrrr)          
Correct Answers : b      
97 Question : _____ command is used in Database management system to fetch the common records from two tables.      
      
sssssssssssssssssssss)    Union      
ttttttttttttttttttttt)    Intersect      
uuuuuuuuuuuuuuuuuuuuu)    Difference      
vvvvvvvvvvvvvvvvvvvvv)    Join      
wwwwwwwwwwwwwwwwwwwww)          
xxxxxxxxxxxxxxxxxxxxx)          
Correct Answers : b      
98 Question : Emp_code in an employee table is _______ in an ER diagram.      
      
yyyyyyyyyyyyyyyyyyyyy)    an attribute      
zzzzzzzzzzzzzzzzzzzzz)    an entity      
aaaaaaaaaaaaaaaaaaaaaa)    an entityset      
bbbbbbbbbbbbbbbbbbbbbb)    an attributeset      
cccccccccccccccccccccc)          
dddddddddddddddddddddd)          
Correct Answers : a      
99 Question : Identify the many-to-many relationships from the following:      
      
eeeeeeeeeeeeeeeeeeeeee)    Student--Course      
ffffffffffffffffffffff)    Employee--Department      
gggggggggggggggggggggg)    Customer--Order      
hhhhhhhhhhhhhhhhhhhhhh)    Students--Roll_No.      
iiiiiiiiiiiiiiiiiiiiii)          
jjjjjjjjjjjjjjjjjjjjjj)          
Correct Answers : a,c      
100 Question : Which global variable is used to view the date, version number and processor type of the current SQL Server?      
      
kkkkkkkkkkkkkkkkkkkkkk)    @@ServerName      
llllllllllllllllllllll)    @@ServiceName      
mmmmmmmmmmmmmmmmmmmmmm)    @@CPU_Busy      
nnnnnnnnnnnnnnnnnnnnnn)    @@Version      
oooooooooooooooooooooo)          
pppppppppppppppppppppp)          
Correct Answers : d      
101 Question : Statement 1:Views can be created using other views
Statement 2:Views can be accessed only in the current database.
Statement 3:Views can contain only 250 columns.
Statement 4:A View is dropped when we drop the corresponding table.
Identify the valid statement/s.      
      
qqqqqqqqqqqqqqqqqqqqqq)    Statement 1      
rrrrrrrrrrrrrrrrrrrrrr)    Statement 2      
ssssssssssssssssssssss)    Statement 3      
tttttttttttttttttttttt)    Statement 4      
uuuuuuuuuuuuuuuuuuuuuu)          
vvvvvvvvvvvvvvvvvvvvvv)          
Correct Answers : d      
102 Question : Update Employee set Sal = Sal + (Sal * .20) where Sal between 2000 and 4000                                                          
What is the output of the above query?      
      
wwwwwwwwwwwwwwwwwwwwww)    The query will  increase the salary by 20% for the employees whose salary is 2000 and 4000      
xxxxxxxxxxxxxxxxxxxxxx)    The query will  increase the salary by 20% for  the employees  whose salary is between  2000 and 4000. It will also include the employees whose salary is 2000 and 4000      
yyyyyyyyyyyyyyyyyyyyyy)    The query will  increase the salary by 20% for  the employees  whose salary is between  2000 and 4000. It will exclude the employees whose salary is 2000 and 4000      
zzzzzzzzzzzzzzzzzzzzzz)          
aaaaaaaaaaaaaaaaaaaaaaa)          
bbbbbbbbbbbbbbbbbbbbbbb)          
Correct Answers : b      
103 Question : A stored procedure is a group of T-SQL statements compiled into a single execution plan.      
      
ccccccccccccccccccccccc)    TRUE      
ddddddddddddddddddddddd)    FALSE      
eeeeeeeeeeeeeeeeeeeeeee)          
fffffffffffffffffffffff)          
ggggggggggggggggggggggg)          
hhhhhhhhhhhhhhhhhhhhhhh)          
Correct Answers : a      
104 Question : Which property ensures that all the transactions have been completed successfully?      
      
iiiiiiiiiiiiiiiiiiiiiii)    Atomicity      
jjjjjjjjjjjjjjjjjjjjjjj)    Consistent      
kkkkkkkkkkkkkkkkkkkkkkk)    Isolated      
lllllllllllllllllllllll)    Durable      
mmmmmmmmmmmmmmmmmmmmmmm)          
nnnnnnnnnnnnnnnnnnnnnnn)          
Correct Answers : a      
105 Question : Following are the types of transactions in SQL Server 2000.      
      
ooooooooooooooooooooooo)    Explicit transaction      
ppppppppppppppppppppppp)    Implicit transaction      
qqqqqqqqqqqqqqqqqqqqqqq)    Autocommit transaction      
rrrrrrrrrrrrrrrrrrrrrrr)    Rollback transaction      
sssssssssssssssssssssss)          
ttttttttttttttttttttttt)          
106 Correct Answers : a,b,c      
Question : Following query in SQL Server 200 is used to fetch the first 10 records from a table which contain 100 records. (Choose all that apply)      
      
uuuuuuuuuuuuuuuuuuuuuuu)    Select * from Table_name      
vvvvvvvvvvvvvvvvvvvvvvv)    Select top 10 * from Table_name      
wwwwwwwwwwwwwwwwwwwwwww)    Select top 10 percent * from Table_name      
xxxxxxxxxxxxxxxxxxxxxxx)    Select * from Table_name top 10      
yyyyyyyyyyyyyyyyyyyyyyy)    Select * from Table_name top 10 percent *      
zzzzzzzzzzzzzzzzzzzzzzz)          
Correct Answers : b,c      
107 Question : Identify the correct sequence of keywords in a SQL Server 2000 query.      
      
aaaaaaaaaaaaaaaaaaaaaaaa)    where---having---groupby      
bbbbbbbbbbbbbbbbbbbbbbbb)    groupby---where---having      
cccccccccccccccccccccccc)    having---where---groupby      
dddddddddddddddddddddddd)    where---groupby---having      
eeeeeeeeeeeeeeeeeeeeeeee)          
ffffffffffffffffffffffff)          
Correct Answers : d      
108 Question : Consider the following Employee table definition
Fields                                      Data_Type
Emp_ID                                     Number
Emp_Name                               Character
Salary                                       Number
Which of the given SQL Server functions cannot be applied to the Emp_Name column?      
      
gggggggggggggggggggggggg)    SUM      
hhhhhhhhhhhhhhhhhhhhhhhh)    MAX      
iiiiiiiiiiiiiiiiiiiiiiii)    MIN      
jjjjjjjjjjjjjjjjjjjjjjjj)    COUNT      
kkkkkkkkkkkkkkkkkkkkkkkk)          
llllllllllllllllllllllll)          
Correct Answers : a      
109 Question : Read the following query.
Select floor(sal) from Employee Where Emp_Name='John'
What will be the output produced by SQL Server, if the salary present in the database is 80.5?      
      
mmmmmmmmmmmmmmmmmmmmmmmm)    80      
nnnnnnnnnnnnnnnnnnnnnnnn)    81      
oooooooooooooooooooooooo)    79      
pppppppppppppppppppppppp)    ERROR      
qqqqqqqqqqqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrrrrrrrrrrr)          
Correct Answers : a      
110 Question : Indexing speeds up the processing of a table. It results into some drawbacks if :      
      
ssssssssssssssssssssssss)    A column is used for searching  frequently      
tttttttttttttttttttttttt)    A column is used for sorting the data      
uuuuuuuuuuuuuuuuuuuuuuuu)    The table size is small      
vvvvvvvvvvvvvvvvvvvvvvvv)    The table size is large      
wwwwwwwwwwwwwwwwwwwwwwww)          
xxxxxxxxxxxxxxxxxxxxxxxx)          
Correct Answers : c      
111 Question : By default, the  primary key creates a ______ index.      
      
yyyyyyyyyyyyyyyyyyyyyyyy)    clustered      
zzzzzzzzzzzzzzzzzzzzzzzz)    nonclustered      
aaaaaaaaaaaaaaaaaaaaaaaaa)    composite      
bbbbbbbbbbbbbbbbbbbbbbbbb)          
ccccccccccccccccccccccccc)          
ddddddddddddddddddddddddd)          
Correct Answers : a      
Question : Identify the query used to view the index created on the table?      
      
eeeeeeeeeeeeeeeeeeeeeeeee)    sp_helpindex <table_name>      
fffffffffffffffffffffffff)    sp_index <table_name>      
ggggggggggggggggggggggggg)    index <table_name>      
hhhhhhhhhhhhhhhhhhhhhhhhh)    index_help <table_name>      
iiiiiiiiiiiiiiiiiiiiiiiii)          
jjjjjjjjjjjjjjjjjjjjjjjjj)          
Correct Answers : a      
112 Question : Name the system stored procedure used to display the information about any database objects.      
      
kkkkkkkkkkkkkkkkkkkkkkkkk)    sp_database      
lllllllllllllllllllllllll)    sp_tables      
mmmmmmmmmmmmmmmmmmmmmmmmm)    sp_stored_procedures      
nnnnnnnnnnnnnnnnnnnnnnnnn)    sp_help      
ooooooooooooooooooooooooo)          
ppppppppppppppppppppppppp)          
Correct Answers : d      
113 Question : _______ is the default mode of a Transaction.      
      
qqqqqqqqqqqqqqqqqqqqqqqqq)    Implicit      
rrrrrrrrrrrrrrrrrrrrrrrrr)    Explicit      
sssssssssssssssssssssssss)    Autocommit      
ttttttttttttttttttttttttt)          
uuuuuuuuuuuuuuuuuuuuuuuuu)          
vvvvvvvvvvvvvvvvvvvvvvvvv)          
Correct Answers : c      
114 Question : What happens when the Distinct clause is used with the Avg function?      
      
wwwwwwwwwwwwwwwwwwwwwwwww)    It will calculate the average  of all the values present in the column      
xxxxxxxxxxxxxxxxxxxxxxxxx)    It will calculate the average of only distinct values i.e it will consider only one value for the repeated values.      
yyyyyyyyyyyyyyyyyyyyyyyyy)    It will give an error      
zzzzzzzzzzzzzzzzzzzzzzzzz)          
aaaaaaaaaaaaaaaaaaaaaaaaaa)          
bbbbbbbbbbbbbbbbbbbbbbbbbb)          
Correct Answers : b      
115 Question : Once the table  definition has been  approved by the end user , the database designer can draw the ERD for the tables.      
      
cccccccccccccccccccccccccc)    TRUE      
dddddddddddddddddddddddddd)    FALSE      
eeeeeeeeeeeeeeeeeeeeeeeeee)          
ffffffffffffffffffffffffff)          
gggggggggggggggggggggggggg)          
hhhhhhhhhhhhhhhhhhhhhhhhhh)          
Correct Answers : b      
116 Question : Which of the following property/ies is/are  invalid for triggers?
1.A trigger is applied to one or more tables
2.A trigger can include any number of SQL statements
3.A trigger is associated with create and alter statements                                   
4.We can hide the definition of a trigger from the user      
      
iiiiiiiiiiiiiiiiiiiiiiiiii)    Statement 1      
jjjjjjjjjjjjjjjjjjjjjjjjjj)    Statement 2      
kkkkkkkkkkkkkkkkkkkkkkkkkk)    Statement 3      
llllllllllllllllllllllllll)    Statement 4      
mmmmmmmmmmmmmmmmmmmmmmmmmm)          
nnnnnnnnnnnnnnnnnnnnnnnnnn)          
Correct Answers : a,c      
117 Question : What is the use of Rollup in SQL Server?:      
      
oooooooooooooooooooooooooo)    It is used to display the grand total.      
pppppppppppppppppppppppppp)    It is used to display the subtotals and grand total.      
qqqqqqqqqqqqqqqqqqqqqqqqqq)    It rollbacks the committed data.      
rrrrrrrrrrrrrrrrrrrrrrrrrr)    None of the above      
ssssssssssssssssssssssssss)          
tttttttttttttttttttttttttt)          
Correct Answers : b      
118 Question : Name the function used to get the identification number of the workstation.      
      
uuuuuuuuuuuuuuuuuuuuuuuuuu)    Host_ID()      
vvvvvvvvvvvvvvvvvvvvvvvvvv)    User_ID()      
wwwwwwwwwwwwwwwwwwwwwwwwww)    Object_ID()      
xxxxxxxxxxxxxxxxxxxxxxxxxx)    Suser_ID()      
yyyyyyyyyyyyyyyyyyyyyyyyyy)          
zzzzzzzzzzzzzzzzzzzzzzzzzz)          
Correct Answers : a      
119 Question : The __________ option prevents the user from viewing the text of the trigger.      
      
aaaaaaaaaaaaaaaaaaaaaaaaaaa)    WITH ENCRYPTION      
bbbbbbbbbbbbbbbbbbbbbbbbbbb)    WITH CIPHERTEXT      
ccccccccccccccccccccccccccc)    WITH SECURITY      
ddddddddddddddddddddddddddd)    WITH UNICODE      
eeeeeeeeeeeeeeeeeeeeeeeeeee)          
fffffffffffffffffffffffffff)          
Correct Answers : a      
120 Question : By default, only the owner of the database has the permission to create a trigger. This permission is transferable.      
      
ggggggggggggggggggggggggggg)    TRUE      
hhhhhhhhhhhhhhhhhhhhhhhhhhh)    FALSE      
iiiiiiiiiiiiiiiiiiiiiiiiiii)          
jjjjjjjjjjjjjjjjjjjjjjjjjjj)          
kkkkkkkkkkkkkkkkkkkkkkkkkkk)          
lllllllllllllllllllllllllll)          
Correct Answers : b      
121 Question : Name the system stored procedure used to enable the nesting of triggers.      
      
mmmmmmmmmmmmmmmmmmmmmmmmmmm)    nested_configure      
nnnnnnnnnnnnnnnnnnnnnnnnnnn)    sp_configure      
ooooooooooooooooooooooooooo)    sp_init      
ppppppppppppppppppppppppppp)    sp_start_triggers      
qqqqqqqqqqqqqqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrrrrrrrrrrrrrr)          
Correct Answers : b      
122 Question : Which of the following statement/s is/are invalid w.r.t triggers?      
      
sssssssssssssssssssssssssss)    A trigger can include any number of SQL statements.      
ttttttttttttttttttttttttttt)    Only an owner of the database can create the trigger.      
uuuuuuuuuuuuuuuuuuuuuuuuuuu)    A trigger can reference a view or a temporary table, but cannot be associated with it.      
vvvvvvvvvvvvvvvvvvvvvvvvvvv)    Trigger permissions are transferable      
wwwwwwwwwwwwwwwwwwwwwwwwwww)    A trigger can be associated with three actions performed on a table, INSERT, UPDATE, and DELETE.      
xxxxxxxxxxxxxxxxxxxxxxxxxxx)    A trigger cannot be used with CREATE DATABASE command.      
Correct Answers : d      
123 Question : What is an index created on two or more columns called?      
      
yyyyyyyyyyyyyyyyyyyyyyyyyyy)    clustered      
zzzzzzzzzzzzzzzzzzzzzzzzzzz)    non clustered      
aaaaaaaaaaaaaaaaaaaaaaaaaaaa)    composite      
bbbbbbbbbbbbbbbbbbbbbbbbbbbb)    mixed      
cccccccccccccccccccccccccccc)          
dddddddddddddddddddddddddddd)          
Correct Answers : c      
124 Question : The global variable @error stores the error number  in SQL Server.      
      
eeeeeeeeeeeeeeeeeeeeeeeeeeee)    TRUE      
ffffffffffffffffffffffffffff)    FALSE      
gggggggggggggggggggggggggggg)          
hhhhhhhhhhhhhhhhhhhhhhhhhhhh)          
iiiiiiiiiiiiiiiiiiiiiiiiiiii)          
jjjjjjjjjjjjjjjjjjjjjjjjjjjj)          
Correct Answers : b      
125 Question : How many clustered indexes  can we have in a table?      
      
kkkkkkkkkkkkkkkkkkkkkkkkkkkk)    1      
llllllllllllllllllllllllllll)    2      
mmmmmmmmmmmmmmmmmmmmmmmmmmmm)    16      
nnnnnnnnnnnnnnnnnnnnnnnnnnnn)    unlimited      
oooooooooooooooooooooooooooo)          
pppppppppppppppppppppppppppp)          
Correct Answers : a      
126 Question : You want the result of the query very fast. Join and subquery will serve your purpose. What you will prefer so that the SQL Server processes the query faster?      
      
qqqqqqqqqqqqqqqqqqqqqqqqqqqq)    Joins      
rrrrrrrrrrrrrrrrrrrrrrrrrrrr)    Subqueries      
ssssssssssssssssssssssssssss)          
tttttttttttttttttttttttttttt)          
uuuuuuuuuuuuuuuuuuuuuuuuuuuu)          
vvvvvvvvvvvvvvvvvvvvvvvvvvvv)          
Correct Answers : a      
127 Question : The following keyword/s cannot be used with Cursors:      
      
wwwwwwwwwwwwwwwwwwwwwwwwwwww)    Read_Only      
xxxxxxxxxxxxxxxxxxxxxxxxxxxx)    Write_Only      
yyyyyyyyyyyyyyyyyyyyyyyyyyyy)    Type_Warning      
zzzzzzzzzzzzzzzzzzzzzzzzzzzz)    Optimistic      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa)          
bbbbbbbbbbbbbbbbbbbbbbbbbbbbb)          
Correct Answers : b      
128 Question : Which of the following normal forms are based on the multivalue and join dependencies?      
      
ccccccccccccccccccccccccccccc)    First Normal Form      
ddddddddddddddddddddddddddddd)    Second Normal Form      
eeeeeeeeeeeeeeeeeeeeeeeeeeeee)    Third Normal Form      
fffffffffffffffffffffffffffff)    Fourth Normal Form      
ggggggggggggggggggggggggggggg)    Fifth Normal Form      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhh)          
Correct Answers : d,e      
129 Question : Is it possible to decrypt the encrypted triggers?      
      
iiiiiiiiiiiiiiiiiiiiiiiiiiiii)    YES      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjj)    NO      
kkkkkkkkkkkkkkkkkkkkkkkkkkkkk)          
lllllllllllllllllllllllllllll)          
mmmmmmmmmmmmmmmmmmmmmmmmmmmmm)          
nnnnnnnnnnnnnnnnnnnnnnnnnnnnn)          
Correct Answers : b      
130 Question : Identify the co-related query.      
      
ooooooooooooooooooooooooooooo)    SELECT city FROM suppliers WHERE supplierid IN (SELECT supplierid FROM products WHERE suppliers.supplierid=products.supplierid)      
ppppppppppppppppppppppppppppp)    SELECT orderid FROM order_details WHERE productid IN ( SELECT productid FROM products)      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqq)    SELECT Account_No, Name FROM Saving_Accounts
rrrrrrrrrrrrrrrrrrrrrrrrrrrrr)      UNION
sssssssssssssssssssssssssssss)    SELECT Account_No, Name FROM Current_Accounts
ttttttttttttttttttttttttttttt)          
uuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    SELECT * FROM authors WHERE city='Salt Lake city'      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv)          
wwwwwwwwwwwwwwwwwwwwwwwwwwwww)          
Correct Answers : a      
131 Question : Which one of the following takes parameters from its parent query?      
      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    Correlated subquery      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyy)    Nested subquery      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzz)    Plain subquery      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)    Join subquery      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)          
cccccccccccccccccccccccccccccc)          
Correct Answers : a      
132 Question : Following are the valid date functions in SQL Server.      
      
dddddddddddddddddddddddddddddd)    GETDATE()      
eeeeeeeeeeeeeeeeeeeeeeeeeeeeee)    DATEADD()      
ffffffffffffffffffffffffffffff)    DATEDIFF()      
gggggggggggggggggggggggggggggg)    DATENAME()      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    DATEPART()      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    all of the above      
Correct Answers : f      
133 Question : When a CHECK constraint is added to an existing table, the CHECK constraint by default is applied to existing data as well as new data.      
      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)    TRUE      
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)    FALSE      
llllllllllllllllllllllllllllll)          
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)          
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)          
oooooooooooooooooooooooooooooo)          
Correct Answers : a      
134 Question : Following mechanisms are provided by SQL Server 2000 for entity integrity?      
      
pppppppppppppppppppppppppppppp)    Primary Key      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)    Unique Key      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)    Foreign Key      
ssssssssssssssssssssssssssssss)    Identity Property      
tttttttttttttttttttttttttttttt)    Check Key      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    Default Key      
Correct Answers : a,b,d      
135 Question : You want to delete all the rows of an Employee table. This should be done without using much system and transaction log resources. Which command will you use?      
      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    Truncate      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwww)    Delete      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    Drop      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)    We can use any of he commands provided by SQL Server for deleting the records. All the commands have same performance w.r.t to the usage of log resources.      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)          
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)          
Correct Answers : a      
136 Question : You want to view the highest paid employee in all the departments. What Keyword will you use in the query?      
      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)    UNION      
ccccccccccccccccccccccccccccccc)    INTERSECT      
ddddddddddddddddddddddddddddddd)    GROUP BY      
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)    ORDERBY      
fffffffffffffffffffffffffffffff)    IN      
ggggggggggggggggggggggggggggggg)    HAVING      
Correct Answers : c      
137 Question : Identify the valid query for viewing only those records wherein the customers have a phone number.      
      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    SELECT * from customer where phone IS NOT NULL      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    SELECT * from customer where phone = NOT NULL      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)    SELECT * from customer where phone NOT NULL      
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)    SELECT * from customer where HAVING phone NOT NULL      
lllllllllllllllllllllllllllllll)          
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)          
Correct Answers : a      
138 Question : State the use of the AS clause in a SQL query?      
      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    It is used to change the name of a resultset  column      
ooooooooooooooooooooooooooooooo)    It is used to assign a name to a derived column.      
ppppppppppppppppppppppppppppppp)    It is used with the scalar function in SQL for calculating large equations.      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)    It is used with the Group By clause to give  the name to the last result set.      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)          
sssssssssssssssssssssssssssssss)          
Correct Answers : a,b      
139 Question : ________  includes all the rows from atleast one table, provided they match the specified conditions.      
      
ttttttttttttttttttttttttttttttt)    Inner Join      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    Outer Join      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    Self Join      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)          
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)          
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)          
Correct Answers : b      
140 Question : Statement 1: Indexed view is supported only by SQL Server Enterprise Edition.
Statement 2: Indexed views improve the performance of complex queries.      
      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)    Only Statement 1 is true      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)    Only Statement 2 is true      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)    Both the statements are true      
cccccccccccccccccccccccccccccccc)    Both the statements are false      
dddddddddddddddddddddddddddddddd)          
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)          
Correct Answers : c      
141 Question : Partitioning columns in Views, existing on each member table must follow the given rules:      
      
ffffffffffffffffffffffffffffffff)    The partitioning columns should not contain NULL value.      
gggggggggggggggggggggggggggggggg)    Partitioning columns must be a part of the primary key of the table.      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    Computed columns cannot be used for partitioning.      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    You should have only two constraints on the partitioning columns      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)          
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)          
Correct Answers : a,b,c      
142 Question : Identify the INVALID option/s with respect to the SCROLL attribute of a CURSOR?      
      
llllllllllllllllllllllllllllllll)    FIRST      
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)    LAST      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    PRIOR      
oooooooooooooooooooooooooooooooo)    NEX``T      
pppppppppppppppppppppppppppppppp)    RELATIVE      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)    PREVIOUS      
Correct Answers : f      
143 Question : The________ attribute of a CURSOR specifies the order of the rows.      
      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)    KEYSET      
ssssssssssssssssssssssssssssssss)    DYNAMIC      
tttttttttttttttttttttttttttttttt)    OPTIMISTIC      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    RESULTSET      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    STATIC      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)          
Correct Answers : a      
144 Question : Unions combine columns from multiple data tables.      
      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    TRUE      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)    FALSE      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)          
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)          
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)          
ccccccccccccccccccccccccccccccccc)          
Correct Answers : b      
145 Question : An ___________ transaction defines the start as well as the end of a transaction.      
      
ddddddddddddddddddddddddddddddddd)    Explicit      
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)    Implicit      
fffffffffffffffffffffffffffffffff)    Autocommit      
ggggggggggggggggggggggggggggggggg)          
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)          
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)          
Correct Answers : a      
146 Question : Which type of isolation level ensures that some other transaction does not update the data?      
      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)    Read Uncommitted      
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)    Read Committed      
lllllllllllllllllllllllllllllllll)    Repeatable Read      
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)    Read transaction      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)          
ooooooooooooooooooooooooooooooooo)          
Correct Answers : c      
147 Question : Once the transaction is committed, it cannot be rolled back.      
      
ppppppppppppppppppppppppppppppppp)    TRUE      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)    FALSE      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)          
sssssssssssssssssssssssssssssssss)          
ttttttttttttttttttttttttttttttttt)          
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)          
Correct Answers : a      
148 Question : What is the use of locking in SQL Server 2000?      
      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    It is used for transactional integrity      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)    It is used for  database consistency.      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    It is used to increase the capability, for transaction recovery.      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)          
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)          
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)          
Correct Answers : a,b      
149 Question : Which type of locks should be used for read-only operations?      
      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)    Pessimistic Lock      
cccccccccccccccccccccccccccccccccc)    Update Locks      
dddddddddddddddddddddddddddddddddd)    Exclusive Locks      
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)    Shared Locks      
ffffffffffffffffffffffffffffffffff)          
gggggggggggggggggggggggggggggggggg)          
Correct Answers : d      
150 Question : Which type of lock ensures that multiple updates cannot be made to the same resource simultaneously?      
      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    Exclusive Locks      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    Optimistic Lock      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)    Update Locks      
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)    Exclusive Locks      
llllllllllllllllllllllllllllllllll)          
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)          
Correct Answers : d      
151 Question : No other transaction can read or modify data locked with an exclusive lock.      
      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    TRUE      
oooooooooooooooooooooooooooooooooo)    FALSE      
pppppppppppppppppppppppppppppppppp)          
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)          
ssssssssssssssssssssssssssssssssss)          
Correct Answers : a      
152 Question : Which type of locks help to avoid deadlock problem?      
      
tttttttttttttttttttttttttttttttttt)    Update Locks      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    Exclusive Locks      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    Shared Locks      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)    Optimistic Lock      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)          
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)          
Correct Answers : a      
153 Question : In the syntax given below,
SET DEADLOCK_PRIORITY { LOW | NORMAL | @deadlock_var }
@deadlock_var is a character variable which specifies :      
      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)    The deadlock-handling method      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)    A deadlock situation      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)    The session is returned to the default deadlock-handling method      
ccccccccccccccccccccccccccccccccccc)    None of the above      
ddddddddddddddddddddddddddddddddddd)          
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)          
Correct Answers : a      
154 Question : Which Statement is used to throw away all the changes since the most recent transaction statement?      
      
fffffffffffffffffffffffffffffffffff)    COMMIT TRANSACTION      
ggggggggggggggggggggggggggggggggggg)    ROLLBACK TRANSACTION      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    BEGIN TRANSACTION      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    SAVE TRANSACTION      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)          
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)          
Correct Answers : b      
155 Question : Which statement is used in SQL Server to indicate that the most recent transaction you started is marked as ready to be saved?      
      
lllllllllllllllllllllllllllllllllll)    COMMIT TRANSACTION      
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)    ROLLBACK TRANSACTION      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    BEGIN TRANSACTION      
ooooooooooooooooooooooooooooooooooo)    SAVE TRANSACTION      
ppppppppppppppppppppppppppppppppppp)          
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)          
Correct Answers : c      
156 Question : The process of refining a database design to ensure data consistency and reduce duplication is known as ___________.      
      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)    Normalization      
sssssssssssssssssssssssssssssssssss)    Data Modeling      
ttttttttttttttttttttttttttttttttttt)    Data Optimizing      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)          
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)          
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)          
Correct Answers : a      
157 Question : You have to define a database to control projects and reports at your college. Each student works with a project team which produces a project report. Identify the relationship between the Student and the Project?      
      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    One-to-One      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)    Many-to-Many      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)    One-to-Many      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)    Many-to-One      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)          
cccccccccccccccccccccccccccccccccccc)          
Correct Answers : b      
158 Question : You must ensure that each row in a table is uniquely identified. What type of constraint/s should you implement and what does it enforce?
      
      
dddddddddddddddddddddddddddddddddddd)    Referential integrity      
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)    Domain integrity      
ffffffffffffffffffffffffffffffffffff)    Entity integrity      
gggggggggggggggggggggggggggggggggggg)    Foreign key constraint      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    Primary key constraint      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    Check constraint      
Correct Answers : c,e      
159 Question : Which of the following describes a SQL Server batch?      
      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)    Executed in a single transaction.      
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)    Compiled into a single unit.      
llllllllllllllllllllllllllllllllllll)    Executed as individual statements.      
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)    Compiled as individual statements.      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    Executed as a single unit.      
oooooooooooooooooooooooooooooooooooo)    A group of SQL statements.      
Correct Answers : b,c,f      
160 Question : Entity integrity is enforced by unique indexes because a unique value exists in each column.      
      
pppppppppppppppppppppppppppppppppppp)    TRUE      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)    FALSE      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)          
ssssssssssssssssssssssssssssssssssss)          
tttttttttttttttttttttttttttttttttttt)          
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)          
Correct Answers : b      
161 Question : Refer to these statements:
SELECT product_id FROM inventories
INTERSECT
SELECT product_id FROM order_items;
Which of the following is true?      
      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    There are syntax errors      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)    Only distinct rows that appear in either result are returned      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    All rows in the results are returned      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)    Only those rows returned by both the queries are returned.      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)          
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)          
Correct Answers : d      
162 Question : Which of the following statement/s with respect to Explicit Transactions? is/are NOT TRUE      
      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)    Explicit transactions are manually configured transactions.      
ccccccccccccccccccccccccccccccccccccc)    Explicit transactions last only for the duration of the transaction.      
ddddddddddddddddddddddddddddddddddddd)    Explicit transactions are started by SQL Server      
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)          
fffffffffffffffffffffffffffffffffffff)          
ggggggggggggggggggggggggggggggggggggg)          
Correct Answers : c      
163 Question : The order and number of columns in a composite index affect query performance      
      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    TRUE      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    FALSE      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)          
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)          
lllllllllllllllllllllllllllllllllllll)          
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)          
Correct Answers : a      
164 Question : Which one of the following variables is used to specify the number of milliseconds the system has been processing since SQL Server was started?      
      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    @@FETCH_STATUS      
ooooooooooooooooooooooooooooooooooooo)    @@CPU_BUSY      
ppppppppppppppppppppppppppppppppppppp)    @@MAX_CONNECTIONS      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)          
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)          
sssssssssssssssssssssssssssssssssssss)          
Correct Answers : b      
165 Question : Following are the types of T-SQL functions.      
      
ttttttttttttttttttttttttttttttttttttt)    Scalar functions      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    Linear functions      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)    Aggregate functions      
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)    Rowset functions      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)          
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)          
Correct Answers : a,c,d      
166 Question : Expression statements are applied in __________ system functions.      
      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)    Scalar      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)    Aggregate      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)    Rowset      
cccccccccccccccccccccccccccccccccccccc)          
dddddddddddddddddddddddddddddddddddddd)          
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)          
Correct Answers : a      
167 Question : Which of the following system function is used to retrieve the User’s login identification name?      
      
ffffffffffffffffffffffffffffffffffffff)    SUSER_NAME([server_user_id])      
gggggggggggggggggggggggggggggggggggggg)    USER_NAME([user_id])      
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)    HOST_NAME()      
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii)    DB_NAME([database_id])      
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)          
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk)          
Correct Answers : a      
168 Question : Joe is working on a Library project. He is designing a database for the required system. The system will perform the shifting of records very frequently. Which one of the following SQL statements will you advise him to use?      
      
llllllllllllllllllllllllllllllllllllll)    DQL      
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm)    DML      
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn)    DCL      
oooooooooooooooooooooooooooooooooooooo)    DDL      
pppppppppppppppppppppppppppppppppppppp)    CCL      
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq)          
Correct Answers : e      
169 Question : Which of the following database file/s is/are always present in the database?      
      
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr)    Primary data files      
ssssssssssssssssssssssssssssssssssssss)    Secondary data files      
tttttttttttttttttttttttttttttttttttttt)    Log files      
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu)    Command data files      
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv)          
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww)          
Correct Answers : a,c      
170 Question : Which one of the following is a valid command for shrinking the size of a database ?      
      
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)    DBCC SHRINKDATABASE(PUBS, 10)      
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)    DB SHRINKDATABASE(PUBS, 10)      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)    DBCC SHRINK(PUBS, 10)      
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)    DBCC SHRINKDATABASE(PUBS,TEMP, 10)      
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)          
ccccccccccccccccccccccccccccccccccccccc)          
Correct Answers : a