بتاريخ: 30 مايو 201312 سنة comment_236863 Consider a table called carrecords with the following structure: name (type: TEXT)price (type: INT)color (type: TEXT) vehicletype (type: TEXT) eg. SEDAN/SUV A customer wants to see the details (name, price, color, vehicletype) of the vehicles that suit his preferences. This is what he says: "If its a black sedan, I'm ready to pay 10,000, but if its red or white, then no more than 8,000. For any other color I won't go above 7,000, except if its an SUV, in which case my budget is upto 15,000 for a black one or upto 14,000 for any other color." Write a query that returns the desired information in ascending order of price. دي كانت المشكلة الاولي انا مش عارف احلها ازاي الراجل طالب حاجات كتيرة جدااا عشان كدة مش عارف اكتب جملة ال select اصلا بالتحديد هكتب اية بعد where فكرت في ال merge بس مش عارف اعملها خالص بيها هل انا كدة بفكر صح ولا فية حاجة تقدر تساعدني احل المطلوب المشكلة الثانية Consider the following tables: department----------deptid (type: INT)deptname (type: TEXT)hours (type: INT)active (type: BIT) employee--------empid (type: INT)empname (type: TEXT)deptid (type: INT)designation (type: TEXT)salary (type: INT) Write a query to return the columns empname and deptname of the employees belonging to those departments that have a head count of 4 or more. The records should be returned in alphabetical order of empname. المشكلة دي انا عارف نصها يعني لو كان قاللي عايز اسماء الموظفين والادارات كنت هستخدم ال join كان شرط الربط هيبقي كدة where deptid.department = deptid.employee انما اللي معمول ب اللون الاحمر دة معناة اية هل معناة عايز اول اربع صفوف أو عابز من اول الصف الرابع وازاي اعمل الحركة دي ارجوكم ساعدوني انا لسة مبتدئ في الاوراكل واهوة بذاكر sql وبحاول احل تاسكات ذي دي علي النت كتييير جداااا عشان ابقي قوي فيها تقديم بلاغ
بتاريخ: 31 مايو 201312 سنة كاتب الموضوع comment_236894 شكرا علي التجاهل التام لسؤالي كأنني احمق أو ما شابة يبدوا انني دخلت مدينة الاشباح !!!! تقديم بلاغ
بتاريخ: 3 يونيو 201312 سنة comment_237068 حياك الله اخي لم تدخل الى مدينة الاشباححل السؤال الاول select name,color,vehicletype,price from carrecords where (vehicletype='sedan'and color='black'and price<=10000) or (vehicletype='sedan'and color in ('white','red')and price<=8000) or (vehicletype='sedan'and color not in ('white','red','black')and price<=7000) or (vehicletype='SUV'and color = 'black'and price<=15000) or (vehicletype='SUV'and color <> 'black'and price<=14000) order by price; حل السؤال الثاني select empname,deptname from empoyee join department using (deptid) where employee.deptid in (select deptid from employee group by deptid having count(deptid)>=4) order by empname; تم تعديل 3 يونيو 201312 سنة بواسطة jadquraan تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.