Write the SQL syntax for the following queries:?
930099
I'll give you an idea of the first one so you can learn how to do this yourself.\n\n1. Find the names who directly supervised by Franklin Wong\nselect * from SomeTable where SupervisedBy='Franklin Wong'\n\nThe rest are no different they are all select statements.\nutilising <, >, =, or, and to develope the sql query
109303
Tom Kyte is a Oracle Guru and has site which you can check for any pl-sql questions - http://asktom.oracle.com/pls/ask/f?p=4950:1:\nAlso he has some books published regarding pl-sql which I have and are highly useful. Oracle has online documentation which is completely searchable and downloadable - http://www.oracle.com/pls/db92/db92.homepage \nThis has lot of details regarding commands with examples.\nFor sample code check this out -\nhttp://www.oracle.com/technology/sample_code/tech/pl_sql/index.html\n\nHope this gets you going. Let me know if you need more help. \n\nGood Luck !!
150186
Dont declare @i as int, but as varchar(20) and assign it like this\n\nSET @i = '1'
882395
a) select <fields> from <table> where <date_field> >= '2006-01-01' and <date_field> <= '2006-12-31'\n\nb) select <fields> from <table> where <date_field> >= '2006-09-01' and <date_field> <= '2006-09-30'\n\nc) select <fields> from <table> where month(<date_field>) = 11\n\nd) select <fields> from <table> where <date_field> >= '2005-05-15 02:00:00' and <date_field> <= '2007-06-04 15:00:00'
638202
These should all work out correctly provided that\n\n1. dept is a proper field name\n2. salary is a proper field name that has a numeric format to it (i.e. number, currency, etc.) - you cannot take an average of text fields\n3. emp is a proper table name\n4. empid is a proper field name - it won't matter if there aren't duplicate empid's, the query will return results as if the GROUP BY statement weren't there if that's the case\n\nThe semicolon is optional in some database programs - in Access, you don't need a semicolon to separate SQL statements.
601218
stmt = connection.createStatement();\n\n// check from User_tables data dictionary table \n//to see if the table exists.\nrset = stmt.executeQuery(" SELECT Table_Name FROM\n                           User_Tables "+ \n                         " WHERE Table_Name='XYZ'");    \n\n// if the resultset of the above query \n//does not have any record, \n//it means table is not existing.\nif (!rset.next())\n{\n          //operation to do if table doesn't exist\n}\nelse\n{\n          //operation to do if table exists\n}
404062
(m)\n\ngoto the following link for logic sql commands\n\nhttp://docs.hp.com/cgi-bin/doc3k/B3060190208.12319/75
923309
Queries can be a very complex things, involving one or more tables of the data-base.\n\nBut any example is specific to the DataBase structure you have. You can read a lot about SQL queries in the "mysql" (http://www.mysql.com/) documentation.
1029388
http://www.vbmysql.com/
1132417
Skip calling the stored proc and use a cursor to grab the rows directly and insert them into the second table.\n\nExample cursor:\n--------------------------\nDECLARE @col1_value VARCHAR(100)\nDECLARE @col2_value VARCHAR(100)\n\nDECLARE cc CURSOR FOR\nSELECT col1, col2\nFROM table1\n\nOPEN cc\n\nFETCH NEXT FROM cc INTO @col1_value, @col2_value\n\nWHILE @@FETCH_STATUS=0\nBEGIN\n\nINSERT INTO table2 (column1, column2)\nVALUES @col1_value, @col2_value\n\nEND\n\nCLOSE cc\nDEALLOCATE cc\n--------------------------
632590
select * from user_sequences
61097
if this is a database question, then the correct answer is c
880176
mysqlimport does exactly that. \n\nhttp://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html
1011647
My coldfusion is pretty rusty (php guy now) but the first question that comes to mind is, rather than use 2 seperate queries, why not use one?\n\nTry SELECT * .... etc\n\nWHERE order_ID = (SELECT MAX(order_ID) FROM Orders)\nORDER BY ... etc.\n\nThis is called a subquery or correlated subquery.  Most SQL databases support the idea.
967189
SQL for finding birthdays on current day:\n\nSelect * from customer where month(birthday) = month(now()) and dayofmonth(birthday) = dayofmonth(now())\n\nOn a given day:\n\nSelect * from customer where month(birthday) = <month> and dayofmonth(birthday) = <day>\n\n(Where <day> is a number you specify from 1-31 and <month> is 1-12)
938312
INSERT INTO table_name (field1, field2, ...) VALUES ('value1','value2'...);
1152738
http://www.devx.com/dbzone/Article/17403/0/page/3\n\nOracle SQL enhances your flexibility with the release of Oracle 9i by supporting additional join syntax. Specifically, Oracle SQL (9i only) supports what it refers to as a natural join. This type of join automatically joins all columns in both tables with the same name—thus eliminating the need to include the join in a WHERE statement. The natural join may be used in both inner and outer joins using the following syntax:\n\n\nSELECT fldlist\nFROM table1 NATURAL JOIN table2