Sql Definition and 77 Threads

  1. W

    SQL query for Records containing a Character

    Hi All, I am trying to do an SQL query for records containing a certain character, say, c , in 'field' I think if the character c is at the beginning, we use : Select ... from table where field like 'c % ' , where % is a wildcard. Similar for cases where the character is at the end, i.e., we...
  2. W

    SQL Queries using Null fields -- Must use "is null" or "is not null"?

    Hi all, This is for SQL queries, sorry ran out of space in the title. Say we are doing a query that includes a null field/attribute. Must we always use either an " Is null" or " Is not null" statement? Thanks.
  3. W

    Downloading Data for Access SQL

    Hi all, I want to do some Access SQL queries on some data. Do I need to have the data in some special format/extension to be able to "use it" , meaning do queries on it within Access SQL? Thanks
  4. Nicosia1

    What is the Intersection of Computer Programming and Music in Nicosia?

    I am a computer programmer, mostly in Windows, but a little bit into open source, Linux and Java. I work a lot in javascript and SQL of one kind or another, both of which are utilized somehow via all common platforms. I am also interested in music, physics, and chemistry. I play piano and...
  5. W

    How to Modify Names in an SQL View?

    Does anyone know how to change names in an SQL view (i.e., a sort of a subset of a database. We may create it by saving a query and then doing a query on this saved query )? Thanks.
  6. W

    [SQL] Referential Integrity Details

    Hi a probably dumb question on Referential Integrity: I think I understand the basic idea/motivation for it, but one thing I am confused about is this: just when/how do we declare a column in a given table T' to be a foreign key related to the primary key for table T? Is it when we...
  7. W

    [SQL] Way of Relating any two Tables?

    Hi all, Say we have a collection T_1, T_2,..., T_n of tables. I would like for any pair to be related. Would it work if I where to select any field, say the primary key PKT_1 for T_1 and insert it (albeit artificially) meaning include it as an attribute in every other table? If we did this...
  8. W

    [SQL] Query using Data from 2 Tables

    Hi, say I am doing a query for which I need data from two tables, on, say the salary of those who teach French from 2-to-3 P.M, and one table T_1 contains the teaching subject and another table T_2 contains the class schedule/hours. Say these two tables are related. Do we then do a query...
  9. W

    [SQL] Order of Appearence in Query Results.

    Hi All, I know that if we use Select * , then the fields in the table will appear in the same order as listed. Same if we list all the fields manually, as in Select field1, field2,.., fieldn . Is it true that the order of the fields is preserved always (I can't think of other cases at this...
  10. W

    Difference Between Sort By, Order By & Group By

    Hi, just curious about the difference between the " Sort By " and " Order By" commands in database. I assume Sort by is used in QBE and "Order by" is used in SQL ? While we're at it, how about "Group By"? Thanks.
  11. B

    How Should Manage Be Represented in an ER Diagram for a Video Rental Company?

    I am doing a ER Diagram for a class and having a lot of trouble with a specific piece of the sentence. Anyway, here is the business requirements we are diagramming: The video rental company has several branches throughout the USA. The data held on each branch is the branch address made up of...
  12. W

    SQL "Where not exists" (nested loops)

    I'm having a hard time understanding how nested loops work in SQL. Find all the people who likes all the hobbies. select p.name from person p where not exists (select * from (select distinct h.hobby from hobby h) as h1 where not exists (select *...
  13. N

    Oracle SQL Query: Employees Managers & Supervisors

    Hello, I have written the below queries, can somebody tell me if they are correct. manager_id in Employee Table - supervisor ; manager_id in departments table - manager. names and department names of managers who do not supervise any employee. select e.first_name|| ' ' ||e.last_name...
  14. J

    Can a Foreign Key Reference a Foreign Key?

    Hi I am trying to create the tables below and having problems with the timeLog table referencing allocation, when I put it into the modified form of Oricle my University uses it dosent like me refrencing the refrenced values it spits out the error: ORA-02256: number of referencing columns must...
  15. C

    SQL: Count No of Students Enrolled in Subjects

    Iam currently coding a database system for a school here, currently this is my database in MYSQL I want to know what SQL code to use to count how many students has enrolled in every subjects in the subjects table the new relation would appear as...
  16. M

    What the best online resource to learn about SQL injection attacks?

    Hallo all, I need a very conceptual and clear cut definition on sql attacks...there are so many forms of definition and material available on internet that I am just so confused...what the most reliable and authentic source to grasp this info. Thanks
  17. DaveC426913

    SQL JOIN Query for Retrieving Pics in Multiple Categories

    I've got 3 tables: Pics - table of my pictures Categories - table of categories that pictures will fall into PicsCategories - a many-to-many table relating pictures to categories. So the primary key of this table consists of a pic field and a category field So now I want to provide a...
  18. C

    Writing SQL Queries: Can You Have 2 Efficient Solutions?

    I just have a general question that I came up with while doing homework for my database class. I was asked to write a specific query, and when I checked my answer against the posted solutions, it was different. I don't know that much SQL (yet), but I'm pretty sure that my query would produce the...
  19. F

    Understanding SQL Relationships and How to Define Them in SQL Server

    I'm trying to learn SQL, specifically for SQL server. One question I have is about defining relationships. I know how to build a relationship graphically (showing that the primary key from one table is the foreign key of another), but I'm not sure how to assert the relationship with an...
  20. P

    Learn SQL Basics - A Guide for Beginners

    please tell me any site where i can study SQL basics. thnx
  21. P

    Boolean operators in SQL - Correct Syntax?

    Hi all, Trying to write an SQL query for the Sloan Digital Sky Survey that uses the NOT operator, and failing miserably. Basically, I'm making photometric cuts in 4-d colour space, and I currently have a selection of inequalities that select enclosed regions of colour space. However, I...
  22. R

    Find Common Elements in Lists: SQL Query or PHP Nested Loops?

    I get a list from a query. Let's say "SELECT name FROM foods WHERE type='fruit';" returns "apple, orange, banana" I get a list from another query, "SELECT name FROM concepts WHERE type='color';" returns "red, orange, yellow" Now what I want is to find the common element(s) in the two...
  23. R

    MySQL: Logging SQL Statements for Debugging PHP Apps

    Goal: I seek to log the SQL statements into a MySQL table, with the time they were executed as an aid to debugging problems with PHP apps I am writing. Problem: MySQL seems to try to interpret the statement, meant to simply be data in a field. When I try to "INSERT" the values, I get MySQL...
  24. K

    Help Joining Two Tables in SQL?

    I'm having trouble getting the following work. Can anyone help me? I have two tables that look like the following: Table 1 Table 2 A B A B C 1 4 1 4 6 2 5 3 6 How do I join both of them such...
  25. P

    Removing Columns After Table Creation Using SQL

    Isn't possible to delete and remove columns after a table has been created? Rows works just fine but columns don't...
  26. P

    How to Display a SQL Database as a Table in a Win32 Program?

    Let's say I'm communicating with a SQL (local) database using sqlite. How would i go about displaying this database as a table in a win32 program using either dev-c++ or MSVS++?
  27. Saint

    I want to learn about networking and SQL

    I want to learn about networking and SQL, where should i start? what books are good for this ? I want to learn the hardware and software knowledge on netwroking. Please suggest to me, thanks.
Back
Top