Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:19:12+00:00 2026-06-15T18:19:12+00:00

Okay, I need some major help with this subject. This is what I need

  • 0

Okay, I need some major help with this subject. This is what I need the view to do. It needs to take Sum of the DKP_Change Column in the Attendance table

 SELECT SUM(a.DKP_Change) FROM Attendance AS a GROUP BY Name

add the value of the initial DKP from the characters table

 SELECT b.Inital_DKP FROM Characters AS b GROUP BY Name

Subtract the sum of the raid drops tabe cost

 SELECT SUM(c.Cost) FROM Raid_Drops AS c GROUP BY Name

I’m entirely new to the idea of VIEWS and i’m not sure where to begin with, the name of the view should be DKP, the columns should be Name and Total_DKP, where total dkp is calculated from teh above select statements.

Here are the creates for all 3 tables.

CREATE TABLE `Attendance` (
 `Date` date NOT NULL,
 `Name` varchar(20) NOT NULL,
 `Hours` int(11) NOT NULL,
 `Penalty` float NOT NULL,
 `Rank` set('Raider','Core','Elite') NOT NULL,
 `Rate` int(11) NOT NULL,
 `DKP_Change` float NOT NULL,
 `RecordNumber` int(11) NOT NULL AUTO_INCREMENT,
 PRIMARY KEY (`RecordNumber`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1

CREATE TABLE `Characters` (
 `ID` int(11) NOT NULL AUTO_INCREMENT,
 `Name` varchar(25) NOT NULL,
 `Class` varchar(25) NOT NULL,
 `Spec` varchar(25) NOT NULL,
 `Position` set('Healer','Tank','DPS') NOT NULL COMMENT 'Healer, Tank, or DPS',
 `Usable` set('Cloth','Mail','Plate') NOT NULL COMMENT 'Type of Usable Armor? Cloth,        Mail, Or Plate',
 `Primary Stat` set('Agility','Strength','Intellect','Healer','Tank') NOT NULL COMMENT     'Used for Sorting Only(ie dps trinket with agility strength dps not eligible)',
 `Initial_DKP` int(11) NOT NULL COMMENT 'DKP given at the start of current tier.',
 `Total_DKP` int(11) NOT NULL COMMENT 'Huge Complicated Mess.',
 PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

CREATE TABLE `Raid_Drops` (
 `Record Number` int(11) NOT NULL,
 `Date` date NOT NULL,
 `Name of Item` varchar(25) NOT NULL,
 `Item Slot` enum('Main Hand','Off Hand','Head','Neck','Shoulder','Back','Chest','Wrist','Hands','Waist','Legs','Feet','Ring 1','Ring 2','Trinket 1','Trinket 2') NOT NULL,
 `Player_Name` varchar(25) NOT NULL,
 `Cost` float NOT NULL,
 PRIMARY KEY (`Record Number`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:19:13+00:00Added an answer on June 15, 2026 at 6:19 pm

    You could

    • Join the three tables in a subselect, grouping on Name
    • Perform your calculations on the results of each subselect

    The only part that’s not entirely clear to me is if the names in Characters are unique or not. If they are, you can drop the group by. If they are not, the AVG might give you unexpected results.

    SQL Statement

    SELECT sumA
           , initialB
           , sumC
           , sumA + initialB - sumC
           , a.Name
    FROM   (
             SELECT Name, SUM(DKP_Change) AS sumA 
             FROM Attendance 
             GROUP BY Name
           ) AS a
           INNER JOIN (
             SELECT Name, Inital_DKP AS initialB 
             FROM Characters 
           ) AS b ON a.Name = b.Name
           INNER JOIN (
             SELECT Name, SUM(Cost) AS sumC 
             FROM Raid_Drops 
             GROUP BY Name
           ) AS c ON c.Name = b.Name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I really need some help with this. I'm new with designing and stuff,
Okay, I need some help here. This is the same old "can't use an
Okay, I am stumped on this one and need some quick help. I have
Okay, I need help. I'm usually pretty good at SQL queries but this one
Okay, so I'm obviously a newbie, but I need some help passing a variable
I need some help with the design of a query. I've got one table
Okay so I am horrible with regular expressions and need some help here. I've
Okay I need help, again! For some reason it is not working, no idea
Okay! I really need your help or some tips I need a program that
Okay need some help on opening an Access database with PHP. Below is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.