tag:blogger.com,1999:blog-4388359364514928532024-03-09T03:30:30.669+05:30My study tableThis is the place where I can put my studied materials.I need to take these at any time.SREENU KALLOOPPARAhttp://www.blogger.com/profile/16214431799352410984noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-438835936451492853.post-25817514230679741922012-03-10T11:00:00.002+05:302012-03-10T11:00:43.050+05:30http://teckadmin.wordpress.com/http://teckadmin.wordpress.com/SREENU KALLOOPPARAhttp://www.blogger.com/profile/16214431799352410984noreply@blogger.com0tag:blogger.com,1999:blog-438835936451492853.post-12512990408004256602010-01-26T19:25:00.000+05:302010-01-26T19:26:51.268+05:30Installation of MYSQL on Linux1.)Download mysql-5.0.51a-linux-i686-glibc23.tar.gz from anywhere.<br />---------<br />2.)Next, let’s create the mysql user and group:<br />---------<br />#groupadd mysql<br />#useradd -g mysql mysql<br /><br />3.)And continue with the actual installation:<br />---------<br />#cd /usr/local<br />#gunzip < /usr/local/src/mysql-5.0.51a-linux-i686-glibc23.tar.gz | tar xvf -<br />#ln -s mysql-5.0.51a-linux-i686-glibc23 mysql<br />#cd /mysql/<br />#scripts/mysql_install_db --user=mysql<br />#chown -R root .<br />#chown -R mysql data<br />#chgrp -R mysql .<br />#########################################################<br />The mysqld binary will search for configuration file under: /etc/my.cnf, <datadir>/my.cnf and <basedir>/my.cnf . You can start with one of the supplied configs (my-small.cnf, my-medium.cnf, my-large.cnf, my-huge.cnf or my-innodb-heavy-4G.cnf) and customize it accordingly to your needs. I chosen to put this one under /usr/local/mysql, so I can have more mysql instances running, each with its local my.cnf:<br />#########################################################<br />#cp support-files/my-medium.cnf my.cnf<br />#vim my.cnf<br />4.)Once you are happy with the config you can start mysql manually using:<br />#bin/mysqld_safe --user=mysql &<br /><br />5.)You can stop it manually with:<br /><br />/usr/local/mysql/bin/mysqladmin shutdown<br /><br />6.)Start MySql >>>>>>>>>>>>><br />/usr/local/mysql/bin/mysql<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SREENU KALLOOPPARAhttp://www.blogger.com/profile/16214431799352410984noreply@blogger.com0tag:blogger.com,1999:blog-438835936451492853.post-7663476176583988122010-01-20T05:26:00.000+05:302010-01-20T05:27:05.121+05:30Installing Cacti on CentOS 5Cacti is a GPL-licensed, scalable, RRDtool-based monitoring program with flexible graphing options. This article describes the process of installing and configuring Cacti on CentOS 5.2.<br />Useful links to this installation were BXtra and TechDB.<br />Per the Cacti documentation, Cacti requires:<br />RRDTool 1.0.49 or 1.2.x or greater<br />MySQL 4.1.x or 5.x or greater<br />PHP 4.3.6 or greater, 5.x greater highly recommended for advanced features<br />A Web Server e.g. Apache or IIS<br />I'd also recommend installing vim, net-snmp, net-snmp-utils, php-snmp, initscripts, perl-rrdtool, and any dependencies.<br />To perform this install, I am logged into Gnome as a normal user, and opened a terminal that is switched to the root user using the su command. I had already installed apache, mysql, and PHP during the original install process of CentOS 5.2.<br />I added a new repository to facilitate this install. To do this, I created a file<br />(/etc/yum.repos.d/dag.repo) containing Dag Wiers repository, which contains rrdtool, among other things.<br />[dag]<br />name=Dag RPM Repository for Red Hat Enterprise Linux<br />baseurl=http://apt.sw.be/redhat/el5/en/i386/dag<br />gpgcheck=1<br />gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt<br />enabled=1<br />You can create this file by typing vim /etc/yum.repos.d/dag.repo and copying and pasting the above information into the file. Be warned that the above text containing the repository is version and architecture-specific.<br />I then typed yum update to update CentOS and the repository list before installing additional software.<br />I installed everything but cacti through yum. You can verify that you have the packages in question (or the version numbers of installed packages) by attempting to install them, as yum will remind you that you already have the latest version installed, as well as the version status of the packages, as shown here:<br /># yum install php httpd mysql mysql-server php-mysql vim-enhanced net-snmp net-snmp-utils php-snmp initscripts perl-rrdtool rrdtool initscripts<br />Loaded plugins: fastestmirror, priorities<br />Loading mirror speeds from cached hostfile<br />* base: pubmirrors.reflected.net<br />* updates: mirror.fdcservers.net<br />* addons: chi-10g-1-mirror.fastsoft.net<br />* extras: mirror.fdcservers.net<br />Setting up Install Process<br />Parsing package install arguments<br />Package php-5.1.6-23.2.el5_3.i386 already installed and latest version<br />Package httpd-2.2.3-22.el5.centos.1.i386 already installed and latest version<br />Package mysql-5.0.45-7.el5.i386 already installed and latest version<br />Package mysql-server-5.0.45-7.el5.i386 already installed and latest version<br />Package php-mysql-5.1.6-23.2.el5_3.i386 already installed and latest version<br />Package 2:vim-enhanced-7.0.109-4.el5_2.4z.i386 already installed and latest version<br />Package 1:net-snmp-5.3.2.2-5.el5_3.1.i386 already installed and latest version<br />Package 1:net-snmp-utils-5.3.2.2-5.el5_3.1.i386 already installed and latest version<br />Package php-snmp-5.1.6-23.2.el5_3.i386 already installed and latest version<br />Package initscripts-8.45.25-1.el5.centos.i386 already installed and latest version<br />Package perl-rrdtool-1.3.7-1.el5.rf.i386 already installed and latest version<br />Package rrdtool-1.3.7-1.el5.rf.i386 already installed and latest version<br />Package initscripts-8.45.25-1.el5.centos.i386 already installed and latest version<br />Nothing to do<br />Download the latest version of Cacti (0.8.7e, as of the writing of this article) from here. I downloaded it to my desktop and unzipped it by right clicking it and selecting "Extract here". I also renamed the cacti-0.8.7e directory by right clicking and selecting "Rename". You could do this in the command line, if you wanted to:<br />[your root shell] # tar xzvf cacti-0.8.7e.tar.gz <br />[your root shell] # mv cacti-0.8.7e cacti<br />Move the entire cacti directory to /var/www/html/ :<br />[your root shell] # mv cacti /var/www/html<br />I chose to create a 'cactiuser' user (and cacti group) to run cacti commands and to have ownership of the relavent cacti files. It was here that I noticed that my install did not have any of the /sbin directories in its $PATH , so I simply typed the absolute path:<br />[your root shell] # /usr/sbin/groupadd cacti <br />[your root shell] # /usr/sbin/useradd -g cacti cactiuser <br />[your root shell] # passwd cactiuser<br />Change the ownership of the /var/www/html/cacti/rra/ and /var/www/html/cacti/log/ directories to the cactiuser we just created<br />[your root shell] # cd /var/www/html/cacti <br />[your root shell] # chown -R cactiuser rra/ log/<br />Create a mysql root password, if you haven't already (password in this example is samplepass:<br />[your root shell] # /usr/bin/mysqladmin -u root password samplepass<br />Create a MySQL database for cacti:<br />[your root shell] # mysqladmin --user=root --password=samplepass create cacti<br />Change directories to the cacti directory, and use the cacti.sql file to create tables for your database:<br />[your root shell] # cd /var/www/html/cacti <br />[your root shell- cacti] # mysql --user=root --password=samplepass cacti < cacti.sql<br />I also created a MySQL username and password for Cacti:<br />[your root shell] # mysql --user=root --password=samplepass<br />Welcome to the MySQL monitor. Commands end with ; or g.<br />Your MySQL connection id is 28<br />Server version: 5.0.45 Source distribution<br />Type 'help;' or 'h' for help. Type 'c' to clear the buffer.<br />mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'samplepass';<br />Query OK, 0 rows affected (0.00 sec)<br />mysql> flush privileges;<br />Query OK, 0 rows affected (0.00 sec)<br />mysql> exit<br />Bye<br />Edit /var/www/html/cacti/include/config.php with your favorite editor, and update the information to reflect our cacti configuration (you can leave the other text in the file alone):<br />/* make sure these values refect your actual database/host/user/password */<br />$database_type = "mysql";<br />$database_default = "cacti";<br />$database_hostname = "localhost";<br />$database_username = "cactiuser";<br />$database_password = "samplepass";<br />$database_port = "3306";<br />Create a cron job that polls for information for Cacti (I'm choosing to use /etc/crontab here):<br />[your root shell] # vim /etc/crontab<br />Add this line to your crontab:<br />*/5 * * * * cactiuser /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1<br />Edit your PHP config file at /etc/php.ini/memory_limit in command mode.<br />[your root shell] # vim /etc/php.ini<br />I changed memory_limit = 8M to memory_limit = 128M<br />Before I check to see if Cacti works, I want to check and see if mysqld and httpd are running using the service command.<br />[your root shell] # /sbin/service mysqld status <br />[your root shell] # /sbin/service httpd status <br />If mysqld and httpd are running, great. If not, type:<br />[your root shell] # /sbin/service mysqld start <br />[your root shell] # /sbin/service httpd start<br />If you're an "I need to see what the output looks like" type, here is an example of the previous command:<br />[your root shell] # /sbin/service mysqld status<br />mysqld is stopped<br />[your root shell] # /sbin/service mysqld start<br />Initializing MySQL database: Installing MySQL system tables...<br />OK<br />Filling help tables...<br />OK<br />To start mysqld at boot time you have to copy<br />support-files/mysql.server to the right place for your system<br />PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !<br />To do so, start the server, then issue the following commands:<br />/usr/bin/mysqladmin -u root password 'new-password'<br />/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'<br />See the manual for more instructions.<br />You can start the MySQL daemon with:<br />cd /usr ; /usr/bin/mysqld_safe &<br />You can test the MySQL daemon with mysql-test-run.pl<br />cd mysql-test ; perl mysql-test-run.pl<br />Please report any problems with the /usr/bin/mysqlbug script!<br />The latest information about MySQL is available on the web at<br />http://www.mysql.com<br />Support MySQL by buying support/licenses at http://shop.mysql.com<br />[ OK ]<br />Starting MySQL: [ OK ]<br />Figure 1<br />You should now be able to access cacti at http://localhost/cacti from the local computer or from any computer within your LAN network at http://your.internal.IP.address/cacti .<br />There should be a Cacti Installation Guide window that shows up, giving licensing info and the like. Click "Next".<br />Select "New Installation", since this is a new installation.<br />The next window to pop up should tell you whether Cacti could find the paths to all of the elements that Cacti needs to run, such as RRDtool, PHP, snmp stuff, etc. If everything but Cacti was installed via yum, you should be good here. Click "Finish" to save the settings and bring up the login window.<br />Figure 1 is a screenshot of the login window. The default user name is admin. The default password is admin. It should prompt an automatic password change for the admin account when you log in the first time.<br />Figure 2<br />If you successfully log in, I'd recommend taking a break here. Depending on how fast you are, your cron job may not have had enough time to run the poller program and create data for your graphs. I'd suggest taking a deep breath, or brewing a cup of tea (or coffee) for yourself.<br />The localhost machine should have some graph templates that are already created, but you can click the "Create Additional Devices" link to add graphs for any other machines on your network. I added my FreeNAS box (tutorial for that to follow).<br />Figure 3<br />After having consumed your beverage of choice, press the "Graphs" button. Cacti should have a graph showing you a couple minutes of data for the machines you have added. The longer your machine is on, the more informational the graphs will be. Also, if you click on a particular graph, Cacti will show you more detail by redrawing the graph on the fly. Cacti is a very flexible tool that allows you to change the colors being graphed as well as the metrics for graphing very easily. Congratulations! You're now monitoring!SREENU KALLOOPPARAhttp://www.blogger.com/profile/16214431799352410984noreply@blogger.com0tag:blogger.com,1999:blog-438835936451492853.post-70859364460544243022010-01-20T05:18:00.000+05:302010-01-20T05:23:14.135+05:30Installation and Configuration of DNS Server-LINUX1 ) Install the dns packages<br /><br />#yum install bind bind-utils bind-chroot caching-nameserver<br /><br />2) Check /etc/resolv.conf<br /><br />cp /etc/resolv.conf /etc/resolv.conf.original<br /><br />vi /etc/resolv.conf<br /><br />Insert,<br />search tornado.com<br />nameserver 127.0.0.1<br /><br />Setting daemon options<br /><br />cp /var/named/chroot/etc/named.conf var/named/chroot/etc//named.conf.original<br /><br />set the permission for named.conf<br /><br />chown root:named named.conf<br /><br />vi /var/named/chroot/etc/named.conf <br /><br />Insert the BOLD;<br /><br />options {<br /> directory "/var/named";<br /> dump-file "/var/named/data/cache_dump.db";<br /> statistics-file "/var/named/data/named_stats.txt";<br /> /*<br /> * If there is a firewall between you and nameservers you want<br /> * to talk to, you might need to uncomment the query-source<br /> * directive below. Previous versions of BIND always asked<br /> * questions using port 53, but BIND 8.1 uses an unprivileged<br /> * port by default.<br /> */<br /> //query-source address * port 53;<br /> listen-on { 127.0.0.1; 10.29.29.112 ; };<br /> allow-query { 127.0.0.1; 10.29.29.0/24; };<br />};<br /><br /><br />If your DNS server is located behind a firewall and is having difficulty with resolving names, you may need to uncomment this directive.<br />query-source address * port 53;<br /><br />The "." zone below tells named to check this file for a list of the root name servers, so it knows where to send external queries. This enables the caching nameserver feature of BIND, by forwarding any unknown requests to the root nameservers listed in the file. This zone should already be listed in the configuration.<br />zone "." IN {<br /> type hint;<br /> file "named.ca";<br />};<br />##################################################################################### You may find that sending every new DNS query to the root name servers will be a little slow. This can be improved by sending all of your queries to a quicker "upstream" DNS server which will process your request for you. An upstream DNS server (like the ones at your ISP) may already have the query you're after in its cache, or it will normally have a faster backbone link to the root name servers.<br /><br />To use forwarders you need to have at least one upstream DNS server IP address. Forwarders are a configuration option which needs to be placed inside the "options" section (place under the "allow-query" option above).<br />#Place INSIDE 'options'<br /><br /> forward first;<br /> forwarders { xxx.xxx.xxx.xxx; xxx.xxx.xxx.xxx; }; <-- Add your ISP's DNS servers in here (IP addresses ONLY)<br />#####################################################################################<br /><br />Adding Your Domain<br />vi /var/named/chroot/etc/named.conf <br />zone "tornado.com" IN {<br /> type master;<br /> file "data.tornado.com";<br /> allow-update { none; };<br />};<br /><br />zone "29.29.10.in-addr.arpa" IN {<br /> type master;<br /> file "reverse-10.29.29";<br /> allow-update { none; };<br />};<br />vi /var/named/chroot/var/named/data.tornado.com<br />The following is an example FORWARD zone file for the "example.com" domain name, it is using private addressing for internal only name resolution.<br />$TTL 1D<br />@ IN SOA thunder.tornado.com. root (<br /> 10 ; Serial<br /> 8H ; Refresh<br /> 2H ; Retry<br /> 4W ; Expire<br /> 1D ) ; Minimum<br />;<br /> IN NS thunder ; Name Server for the domain<br /> IN MX 10 thunder ; Mail Exchange<br />;<br />tornado.com. IN A 10.29.29.112 ; IP address for the domain tornado.com<br />thunder IN A 10.29.29.112 ; IP address for ' thunder'<br />www IN CNAME thunder ; ' thunder ' is also known as www<br />ftp IN CNAME thunder ; ' thunder ' is also known as ftp<br />;<br />=========================<br />The forward zone file allows name resolution from NAME to IP address. To allow name resolution from IP address to NAME, we need to configure a REVERSE zone file.<br />vi /var/named/chroot/var/named/reverse-10.29.29<br />$TTL 1D<br />@ IN SOA thunder.tornado.com. root (<br /> 10 ; Serial<br /> 8H ; Refresh<br /> 2H ; Retry<br /> 4W ; Expire<br /> 1D ) ; Minimum<br />;<br /> IN NS thunder.tornado.com.<br />1 IN PTR thunder.tornado.com.<br /><br /><br />The following are some of the common parameters (and definitions) required to configure our zone files.<br />Parameter Definition<br />$TTL Time To Live for the zone file<br />IN The Internet system<br />SOA Start Of Authority to administer zone<br />NS Name Server for the zone<br />MX Mail Exchange for the zone (needs a priority value)<br />A Address records for hosts / network equipment<br />CNAME Canonical name for an alias (points to "A" record)<br /><br />chown named.named /var/named/chroot/var/named/data.tornado.com<br />chown named.named /var/named/chroot/var/named/reverse-10.29.29<br />Checking Your Work<br />named-checkconf /var/named/chroot /etc/named.conf<br />named-checkzone -d tornado.com /var/named/chroot/var/named/data.tornado.com<br />loading "example.com" from "/var/named/master-example.com" class "IN"<br />zone example.com/IN: loaded serial 10<br />OK<br />named-checkzone -d 29.29.10.in-addr.arpa //var/named/chroot/var/named/reverse-10.29.29<br /><br />loading "1.168.192.in-addr.arpa" from "/var/named/data/reverse-192.168.1" class "IN"<br />zone 1.168.192.in-addr.arpa/IN: loaded serial 10<br />OK<br /><br /><br /><br /><br />Starting BIND<br />chkconfig --level 2345 named on<br />/etc/init.d/named restart<br />chkconfig --list named<br />grep named /var/log/messages<br />galaxy named[19111]: starting BIND 9.3.2 -u named -t /var/named/chroot<br />galaxy named[19111]: found 2 CPUs, using 2 worker threads<br />galaxy named[19111]: loading configuration from '/etc/named.conf'<br />galaxy named[19111]: listening on IPv4 interface lo, 127.0.0.1#53<br />galaxy named[19111]: listening on IPv4 interface eth1, 192.168.1.1#53<br />galaxy named[19111]: command channel listening on 127.0.0.1#953<br />galaxy named[19111]: zone 0.in-addr.arpa/IN: loaded serial 42<br />galaxy named[19111]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700<br />galaxy named[19111]: zone 1.168.192.in-addr.arpa/IN: loaded serial 10 <-- Successful load<br />galaxy named[19111]: zone 255.in-addr.arpa/IN: loaded serial 42<br />galaxy named[19111]: zone example.com/IN: loaded serial 10 <-- Successful load<br />galaxy named[19111]: zone localdomain/IN: loaded serial 42<br />galaxy named[19111]: zone localhost/IN: loaded serial 42<br />galaxy named[19111]: running<br /><br />Testing The Server<br />[bash]# dig www.example.com<br /><br />; <<>> DiG 9.3.2 <<>> www.example.com<br />;; global options: printcmd<br />;; Got answer:<br />;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48535<br />;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 0<br /><br />;; QUESTION SECTION:<br />;www.example.com. IN A<br /><br />;; ANSWER SECTION:<br />www.example.com. 86400 IN CNAME galaxy.example.com.<br />galaxy.example.com. 86400 IN A 192.168.1.1 <-- Correct IP address returned<br /><br />;; AUTHORITY SECTION:<br />example.com. 86400 IN NS galaxy.example.com.<br /><br />;; Query time: 3 msec<br />;; SERVER: 127.0.0.1#53(127.0.0.1) <-- Query from local server<br />;; WHEN: Wed May 17 21:16:38 2006<br />;; MSG SIZE rcvd: 84<br /><br />dig example.com AXFR @localhost<br /><br />; <<>> DiG 9.3.2 <<>> example.com AXFR @localhost<br />; (1 server found)<br />;; global options: printcmd<br />example.com. 86400 IN SOA galaxy.example.com. sysadmin.example.com. 10 28800 7200 2419200 86400<br />example.com. 86400 IN NS galaxy.example.com.<br />example.com. 86400 IN MX 10 galaxy.example.com.<br />example.com. 86400 IN A 192.168.1.1<br />ftp.example.com. 86400 IN CNAME galaxy.example.com.<br />galaxy.example.com. 86400 IN A 192.168.1.1<br />wkstn1.example.com. 86400 IN A 192.168.1.201<br />wkstn2.example.com. 86400 IN A 192.168.1.202<br />www.example.com. 86400 IN CNAME galaxy.example.com.<br />example.com. 86400 IN SOA galaxy.example.com. sysadmin.example.com. 10 28800 7200 2419200 86400<br />;; Query time: 2 msec<br />;; SERVER: 127.0.0.1#53(127.0.0.1) <-- Query from local server<br />;; WHEN: Wed May 17 21:17:21 2006<br />;; XFR size: 9 records (messages 1)<br /><br />host 10.29.29.112<br />201.1.168.192.in-addr.arpa domain name pointer wkstn1.example.com.SREENU KALLOOPPARAhttp://www.blogger.com/profile/16214431799352410984noreply@blogger.com0tag:blogger.com,1999:blog-438835936451492853.post-65701951422086472062010-01-20T04:39:00.000+05:302010-01-20T05:13:52.619+05:30Basics of MYSQL1.)Table creation on sql<br />***********************<br /><br />create table contact<br />(<br />id INT NOT NULL AUTO_INCREMENT <br />PRIMARY KEY,<br />first_name varchar (30),<br />Last_name varchar (30),<br />phone varchar (15)<br />)<br /><br />#######################<br /><br />desc contact<br /><br />#######################<br /><br />2.)Adding Values to TABLES<br />************************<br />insert into contact values<br />(<br />1,'Remya','Gopi','90*6***40'<br />)<br />#######################<br />3.)For updating table values<br />***************************<br />select * from contact<br />update contact<br />set phone = '04683333'<br />where id = 1<br /><br />#######################<br /><br />4.)For delete value from TABLE<br />*****************************<br />delete from contact<br />where id = 1<br /><br />#######################<br /><br />5.)For deleting a TABLE<br />***********************<br />drop table contact<br /><br />#######################<br /><br />6.)Adding a column on a table<br />***************************<br />alter table test add state varchar2 (2)<br /><br />#######################<br /><br />7.)Deleting a column on a table<br />*******************************<br />alter table noc DROP COLUMN salary <br /><br />#######################<br /><br />8.)Comparison<br />***************<br />select * from list<br />where age >= '25'<br />========================<br />select * from ardc<br />where id = '1' or id = '2'<br /><br />select * from ardc<br />where id != '1' and id = '2'<br /><br />#######################<br /><br />9.)IN or NOT IN<br />**************<br /><br />select * from ardc<br />where id not in (1,3)<br /><br />select * from ardc<br />where id in (1,3)<br /><br />select * from ardc<br />where name not in ('Sreenu Raghavan','Ratheesh')<br /><br />select * from ardc<br />where name in ('Sreenu Raghavan','Ratheesh')<br /><br />#######################<br /><br />10.)BETWEEN or NOT BETWEEN<br />***********************<br />select * from ardc<br />where id between 1 and 3<br /><br />select * from ardc<br />where id >= 1 and id <= 3<br /><br /><br />select * from ardc<br />where id not between 1 and 3<br /><br /><br />select * from ardc<br />where id < 1 or id > 3<br /><br />#######################<br /><br />11.)LIKE or NOT LIKE with % or _<br />********************<br />select * from ardc<br />where name like 'S%'<br /><br />select * from ardc<br />where name like 'S_ee_u%'<br /><br />select * from ardc<br />where name not like 'S_ee_u%'<br /><br />#######################<br /><br />12.)< or ><br />*******<br />select * from noc<br />where salary < prev_salary<br /><br />select * from noc<br />where name > 'S'<br />select * from noc<br />where name > 'Na'<br /><br />B > A<br />C > B<br />a > A<br /><br />#######################<br /><br />13.)NULL<br />******<br />1)insert into noc values<br />(7,'pratheek','madiwala','3000',null)<br /><br />2)insert into noc (sl,name,house,salary) values<br />(7,'pratheek','madiwala','3000')<br /><br />3)select * from noc<br />where prev_salary = null >>>> Wrong<br /><br />select * from noc<br />where prev_salary != null >>>>>Wrong<br /><br /><br />select * from noc<br />where prev_salary is null >>>>>Correct<br /><br />select * from noc<br />where prev_salary is not null >>>>>>Correct<br /><br />#######################<br /><br />14.)ORDER<br />******<br />select * from noc<br />order by name<br />=<br />select * from noc<br />order by salary,sl<br />=<br />select * from noc<br />order by 1 >>>Column Number<br />=<br />select sl,name from noc<br />order by 2 >>>>order should be as per select list<br /><br />#######################<br /><br />15.)ORDER_descending order<br />**********************<br />select * from noc<br />order by name desc<br />==<br />select * from noc<br />order by salary desc ,sl desc<br />==<br />select sl,name,salary from noc<br />order by 3 desc<br />===============================<br />select * from ardc<br />where (salary > '2000' or dept ='1') and year = '2008'<br /><br />select * from ardc<br />where salary > '2000' or (dept ='1' and year = '2008')<br /><br />select * from ardc<br />where dept ='1' and year = '2007'<br /><br />3 Ratheesh 2600 1 2008<br />4 Robin 2600 2 2008<br />1 Sreenu Raghavan 6000 1 2007<br />2 Nithin Kumar 6000 2 2007<br />###########################################################<br />###########################################################SREENU KALLOOPPARAhttp://www.blogger.com/profile/16214431799352410984noreply@blogger.com0