Archive

Posts Tagged ‘sql query’

Sql Query

October 15th, 2011 Comments off

I just need a query in SQL for the following: Create a heading of REPORTING STATEMENTS as a comment at the bottom of your script file

Categories: Query, SQL Tags: , , ,

Fix Sql Query

January 9th, 2010 Comments off

I have a stock photography website, on the main page it displays a group of “components” that show things like new photos, featured photos, free photos, etc.

The problem is, there are some nude images on the site. I have created a category for them to reside in, but I would prefer that they not show up on the main page.

This project should be fairly simple for someone who knows what they are doing, so no outrageous bids. It will involve editing 1 or 2 files, and looking at the DB structure.

Write Me A Sql Query 2

July 31st, 2009 Comments off

Hello,
You’ll just write me a sql query and php codes. My table is in PMB, please check.

Categories: MySQL, PHP Tags: , , , ,

Write Me A Sql Query

July 27th, 2009 Comments off

Hello,
I need only SQL query, no PHP code. Here is database structure:

members table:
id
username
age
country

friends table:
id
userid
friendid

Here is export of friends table:

INSERT INTO `friends` (`id`, `userid`, `friendid`, `active`) VALUES
(4, 2839, 2926, 1),
(5, 2927, 2839, 1),
(6, 1, 2839, 1),;

What I want to achieve is to get friend list of any member. Attention that, memberid can be userid or friendid.. Please give me solution, if sql query works, I’ll pay you $10. See my reviews please.

Categories: MySQL, PHP Tags: , , , , ,

Data Changes & Sql Statements

July 13th, 2009 Comments off

Use the database and tables from last week’s assignment to write SQL statements and enter records into the Employee table for workers identified in the employee files for the administrative offices and the Del Mar store. Check results by selecting all columns from both tables.

Sql Good 3

June 18th, 2009 Comments off

(You are to put all your screen snapshots for the items below, each showing the required SQL statements and results, in order, in a single Microsoft Word file. Failure to do so may result in lost points on this assignment.)

Using the database and tables from Week Two, write SQL statements and enter the records into the Employee table for the workers identified in the Employee Files for the administrative offices and the Del Mar location. Check the results by selecting all of the columns from both of your tables. You should now have 17 total employees and 9 total job titles (2 points)

Using the database and tables in Week Two, write SQL queries using Between, Like and Union: (1 point each)

Sql Query

June 18th, 2009 Comments off

I need this query completed right away. I am not able to provide access or give you a copy of any part of the database. I am online right now on MSN Messenger to work with you though on getting this done right away. Please only bid if you understand the project. If you have any questions message.

This project uses 5 queries.

1. Retrieve the Group Items
2. Check each individual item combination
3. Check inventory for each individual item combination
4. If IN STOCK is greater than zero run query4 if not run query5.

QUERY1:
SELECT * FROM ITEMS
WHERE CUSTCHAR3 LIKE ‘%ST%’ AND MATRIX_ITEM_TYPE = ’0′

*** FOREACH RESULT FOR OF QUERY1 RUN QUERY2: ***

QUERY2:
SELECT * FROM MATRIX_ITEMS
WHERE MATRIX_GROUP_CODE = ”)

*** FOREACH RESULT OF QUERY2 RUN QUERY 3. ***

QUERY3:
SELECT * FROM ITEMS
WHERE Q_ON_RESER < QTY_STK AND QUERY2.MATRIX_ITEMS.ITEM_CODE

IF QUERY3 RETURNS A RESULT UPDATE INSTOCK BY ’1′

** FINALLY IF IN STOCK IS GREATER THAN 0 RUN QUERY 4 OTHERWISE RUN QUERY 5 **

QUERY4:

INSERT INTO ITEM_EQ
(ACTIVE,EQ_CODE,ITEMNO,DESCRIPT,SELLPRIC_O,CREATED_BY,CREAT_DATE,WEB_ACTIVE,CATEGORY,CUSTCHAR3,MEAS_CODE)
SELECT ‘T’,Items.ITEMNO + ‘-2′,ITEMS.ITEMNO,ITEMS.DESCRIPT,’F',’SUP32′,GETDATE(),’T',CASE
WHEN Items.Category LIKE ‘BB%’ THEN ‘BUCKLES’
ELSE ‘TLS’
END
,’[ST]‘,’EA’
FROM ITEMS
WHERE CUSTCHAR3 LIKE ‘%ST%’ AND ACTIVE = ‘T’ AND WEB_ACTIVE = ‘T’
AND ITEMS.ITEMNO = ITEMS.ITEMNO (FROM QUERY1)
and not exists (select * from ITEM_EQ Where EQ_CODE = ITEMS.ITEMNO (FROM QUERY1) + ‘-2′);

QUERY5:

DELETE FROM ITEM_EQ
WHERE EXISTS
( select ITEMS.ITEMNO
from ITEMS
where ITEMS.ITEMNO = ITEMS.ITEMNO (FROM QUERY1) AND ITEMS.QTY_STK = 0 AND ITEMS.CUSTLOG4 = ‘F’ AND CUSTCHAR3 LIKE ‘%ST%’ AND ITEM_EQ.CREATED_BY = ‘SUP32′);

Create Database & Sql Query

May 8th, 2009 Comments off

Hello,
I need someone who able to create database for me based on a form that I’ll supply. Please ask for form URL first, so I understand you read this description :) After creating database, you need to write sql query accordingly.

- Form purpose is adding property to real estate database. So, you need to decide if you’d use innodb or myisam database.

- Experince on real estate database has priority, please tell me on
PMB.
- I’ll escrow full amount.
- Delivery must be in 2-3 hours, if not I’ll cancel project.
- If I happy with your work, I’ll give you another task.

Two Sql Projects

April 27th, 2009 Comments off

Project #1

Save all of your code in Notepad as a *.txt file and attach it when you submit the project. Take screen shots of all successful implementation of each set of SQL.

Data Changes and SQL Statements

Resource: Table Queries assignment

Use the database and tables that are attached to write SQL statements and enter records into the Employee table for workers identified in the employee files for the administrative offices and the store. Check results by selecting all columns from both tables.

Between, Like, and Union:

Write a SQL query that joins two tables in the example database and uses BETWEEN to restrict record selection. Use salary to restrict data.

Write a SQL query that joins two tables in the example database and uses BETWEEN to restrict record selection. Use hire dates to restrict data.
Write a SQL query that joins two tables in the example database and uses LIKE to restrict record selection. Use telephone area codes to restrict data.

Write a SQL query that joins two tables in the example database and uses LIKE to restrict record selection. Use age to restrict data.

Write a SQL query that uses the UNION of the two tables to produce a third table.

Save each query in a txt file and take a screen shot of its results and submit them as an attachment.

Group:

Use the updated database to write the following queries, using the SQL GROUP statement:

Select employees’ last names and group them by EEO-1 classification.

Select employees’ last names and group them by salary.

Select employees’ last names and group them by salary in their EEO-1 classification.

Select employees’ last names and group them by salary in job titles, grouped into exempt and non-exempt.

Save all the SQL statements in a txt file and submit as an attachment.

Screen Shot

Sql Query (re Post)

March 18th, 2009 No comments

I currently make my own leather goods and use specific items to make them. I need an all SQL QUERY written that will tell me how much of each specific item I used (Example, Snaps, Studs, Leather, etc…) to make one item. Then it needs to calculate that by the total sales for a given date period and then show me a report totalling the usage of each item. I need this to be done in all SQL so I can use it in an existing program that only supports custom sQL QUERIES.
The queries I believe needed are below.

QUERY 1:

SELECT x_invoic.x_invoice_id, x_invoic.qty_ship, items.descript, items.brand,
invoices.date_fld
FROM (x_invoic INNER JOIN items ON x_invoic.item_code = items.itemno)
INNER JOIN invoices ON (x_invoic.status = invoices.status) AND (x_invoic.order_no = invoices.doc_no)
WHERE invoices.status=’9′ AND items.matrix_item_type=’2′ AND invoices.date_fld >= ’2008-01-01′ AND invoices.date_fld <= ’2009-01-01′
AND items.brand=’solesu’AND x_invoic.dept <> ‘wholesale’

foreach query1 we need to loop through the results.
and run this subquery1

SELECT ITEM_UPG.*,ITEMS.LAST_COST
FROM ITEM_UPG, ITEMS
WHERE ITEM_UPG.ITEM_CODE = X_INVOIC.ITEM_CODE (FROM QUERY 1) AND ITEMS.ITEMNO = ITEM_UPG.ITEM_CODE

THEN FOR EACH SUB QUERY1 we need loop thru the results

FINALLY WE NEED TO ELIMINATE DUPLICATES AND MERGE THEIR ITEM_UPG.UPG_PRIC field (this is the quantity
field so the total needs to be tabulated and displayed in one row).

Note: Some leather items we make use some of the same raw materials as define din the ITEM_UPG table.
Therefor you will have duplicates showing for hardware item and need to eliminate them and merge their
UPG_PRIC (QUANTITY FIELD) somehow to tabluate the total quantity.

FINAL DISPLAY RESULT SHOULD SHOW SUBQUERY1 AFTER DUPLICATES
HAVE BEEN REMOVED AND THE UPG_PRIC (QUANTITY FIELD) HAS BEEN TABULATED ACCORDINGLY.

ITEM_CODE | COST PER ITEM | TOTAL QUANTITY USED
BUCKLE1 | 12 | 24
BUCKLE3 | 11 | 12
LEATHER | 8 | 12.3

NOTE: I do not have the ability to provide access to our database or data. YOu will have to work with me on messenger or via email to have me test this as you work on it.

Sql Query

March 17th, 2009 No comments

I currently make my own leather goods and use specific items to make them. I need an all SQL QUERY written that will tell me how much of each
specific item I used (Example, Snaps, Studs, Leather, etc…) to make one item. Then it needs to calculate that by the total sales for a
given date period and then show me a report totalling the usage of each item. I need this to be done in all SQL so I can use it in an existing
program that only supports custom sQL QUERIES.

1. SELECT x_invoic.x_invoice_id, x_invoic.qty_ship, items.descript, items.brand,
invoices.date_fld
FROM (x_invoic INNER JOIN items ON x_invoic.item_code = items.itemno)
INNER JOIN invoices ON (x_invoic.status = invoices.status) AND (x_invoic.order_no = invoices.doc_no)
WHERE invoices.status=’9′ AND items.matrix_item_type=’2′ AND invoices.date_fld >= ’2008-01-01′ AND invoices.date_fld <= ’2009-01-01′
AND items.brand=’solesu’AND x_invoic.dept <> ‘wholesale’

2. SELECT * FROM ITEM_UPG WHERE ITEM_CODE = ITEMS.ITEMNO (FROM STEP 1)

3. Total up the quantity used of each item (as found in the UPG_PRIC field from Step 2.)

4. Retrieve the last_cost field of each item retrieved in Step 2.

SELECT ITEMNO,LAST_COST FROM ITEMS WHERE ITEMNO = ITEM.UPG.UPG_CODE (from Step 2) and display it in a column.

FINAL RESULT EXAMPLE (FIELDS FROM ITEM_UPG):

ITEM_CODE | UPG_CODE | LAST_COST | QUANTITY TOTAL USED
BUCKLE | 24 | 2.56 | 34
SNAP-A | 12 | 2.24 | 23
LEATHER-A | 0.5 | 3.50 | 12.5

Bear